You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Julien Vermillard <jv...@archean.fr> on 2008/11/06 16:16:33 UTC

poll VmPipe

Hi,

Do you use VmPipe ? Because more I look at it, more I feel like
pressing "CTRL+A DEL".

It's somewhat a lot of code for not a really frequent usage, if you
want to send object in the same JVM, use a queue.

Julien

Re: poll VmPipe

Posted by Emmanuel Lecharny <el...@gmail.com>.
Julien Vermillard wrote:
> Hi,
>
> Do you use VmPipe ? Because more I look at it, more I feel like
> pressing "CTRL+A DEL".
>
> It's somewhat a lot of code for not a really frequent usage, if you
> want to send object in the same JVM, use a queue.
>   
This is a pretty good point. Not sure if anyone uses VMPipe, and not 
sure either that it's really necessary when you have all sorts of Queues 
since Java 1.5 (remember that this class has been created when we were 
using Java 1.4).

I think it's pretty much useless now, too.

Anywone ?

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: Re : poll VmPipe

Posted by Emmanuel Lecharny <el...@gmail.com>.
Julien Vermillard wrote:
>> Kind of mixed approach to please everyone :)  
>>
>>     
>
> Good idea, but does it's really hurting anyone to delete the whole
> thing ? :)
>   
I bet you posted your initial mail to know if anyone will be hurt ;)

PS : trying to please everyone is the best way to please no one ...

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: Re : poll VmPipe

Posted by Julien Vermillard <jv...@archean.fr>.
On Thu, 6 Nov 2008 15:44:44 +0000 (GMT)
Edouard De Oliveira <do...@yahoo.fr> wrote:

> Don't know the code underneath VmPipe but is it possible to quickly
> rewrite it using blocking queues thus using new JDK abilities and
> reducing the codebase as seems to suggest Emm ?
> 
> Kind of mixed approach to please everyone :)  
> 

Good idea, but does it's really hurting anyone to delete the whole
thing ? :)

>  Cordialement, Regards,
> -Edouard De Oliveira-
> http://tedorg.free.fr/en/main.php
> 
> 
> 
> 
> ________________________________
> De : Emmanuel Lecharny <el...@gmail.com>
> À : dev@mina.apache.org
> Envoyé le : Jeudi, 6 Novembre 2008, 16h34mn 20s
> Objet : Re: poll VmPipe
> 
> Dan Creswell wrote:
> > Hmmm, if VmPipe is done right it should allow me to build an
> > app/service on top of MINA that can easily be tested all inside of
> > a single JVM (good for unit testing amongst other things) or
> > deployed fully networked with minimum code disruption.
> >  
> Well, if you just use VmPipe to unit test your deployed networked
> development, then I think that the potential improvement you may gain
> from avoiding an encoding/decoding call is irrelevant. More than
> that, I would expect my unit test to behave as the real program
> works, ie using the sockets instead of a fake communication inside
> the JVM.
> 
> AFAIR, the base idea was to eliminate the need to use sockets to
> exchange data between two threads in the same JVM. Blocking queues
> are ok for such purpose those days, no ?
> 
> -- --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
> 
> 
>       

Re: Re : poll VmPipe

Posted by Emmanuel Lecharny <el...@gmail.com>.
Edouard De Oliveira wrote:
> Don't know the code underneath VmPipe but is it possible to quickly rewrite it using blocking queues thus using new JDK abilities and reducing the codebase as seems to suggest Emm ?
>   
That's a pretty good idea ! We have the Tennis sample, it would be 
worthly to rewrite it using queues to see what it brings (and it was 
Julien's idea, btw)


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re : poll VmPipe

Posted by Edouard De Oliveira <do...@yahoo.fr>.
Don't know the code underneath VmPipe but is it possible to quickly rewrite it using blocking queues thus using new JDK abilities and reducing the codebase as seems to suggest Emm ?

Kind of mixed approach to please everyone :)  

 Cordialement, Regards,
-Edouard De Oliveira-
http://tedorg.free.fr/en/main.php




________________________________
De : Emmanuel Lecharny <el...@gmail.com>
À : dev@mina.apache.org
Envoyé le : Jeudi, 6 Novembre 2008, 16h34mn 20s
Objet : Re: poll VmPipe

Dan Creswell wrote:
> Hmmm, if VmPipe is done right it should allow me to build an app/service on
> top of MINA that can easily be tested all inside of a single JVM (good for
> unit testing amongst other things) or deployed fully networked with minimum
> code disruption.
>  
Well, if you just use VmPipe to unit test your deployed networked development, then I think that the potential improvement you may gain from avoiding an encoding/decoding call is irrelevant. More than that, I would expect my unit test to behave as the real program works, ie using the sockets instead of a fake communication inside the JVM.

AFAIR, the base idea was to eliminate the need to use sockets to exchange data between two threads in the same JVM. Blocking queues are ok for such purpose those days, no ?

-- --
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


      

Re: poll VmPipe

Posted by Dan Creswell <da...@gmail.com>.
Hello,

On Thu, Nov 6, 2008 at 3:34 PM, Emmanuel Lecharny <el...@gmail.com>wrote:

> Dan Creswell wrote:
>
>> Hmmm, if VmPipe is done right it should allow me to build an app/service
>> on
>> top of MINA that can easily be tested all inside of a single JVM (good for
>> unit testing amongst other things) or deployed fully networked with
>> minimum
>> code disruption.
>>
>>
> Well, if you just use VmPipe to unit test your deployed networked
> development, then I think that the potential improvement you may gain from
> avoiding an encoding/decoding call is irrelevant. More than that, I would
> expect my unit test to behave as the real program works, ie using the
> sockets instead of a fake communication inside the JVM.
>

Wherever possible it's nice to have unit tests that reflect the real world,
agreed.  However it's not always possible and in fact sometimes it's
advantageous to take some complexity out enabling a broader set of tests
that run faster and allow more convenient testing of the code on either side
of the connection.  This has certainly helped me do basic failure/recovery
testing in the past (though I've not tried this pattern with MINA yet, but
would because it's been useful in the past).

All of that said, you are the maintainers and so ultimately you get to
choose what's appropriate for your code and what you want it to support (and
sometimes you know better than your users).

Cheers,

Dan.


> AFAIR, the base idea was to eliminate the need to use sockets to exchange
> data between two threads in the same JVM. Blocking queues are ok for such
> purpose those days, no ?
>

>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>

Re: poll VmPipe

Posted by Emmanuel Lecharny <el...@gmail.com>.
Dan Creswell wrote:
> Hmmm, if VmPipe is done right it should allow me to build an app/service on
> top of MINA that can easily be tested all inside of a single JVM (good for
> unit testing amongst other things) or deployed fully networked with minimum
> code disruption.
>   
Well, if you just use VmPipe to unit test your deployed networked 
development, then I think that the potential improvement you may gain 
from avoiding an encoding/decoding call is irrelevant. More than that, I 
would expect my unit test to behave as the real program works, ie using 
the sockets instead of a fake communication inside the JVM.

AFAIR, the base idea was to eliminate the need to use sockets to 
exchange data between two threads in the same JVM. Blocking queues are 
ok for such purpose those days, no ?

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: poll VmPipe

Posted by Maarten Bosteels <mb...@gmail.com>.
I haven't used it either.

Our app has a service layer (independant of MINA) and a network layer
(based on MINA obviously).
When I want to test service layer, I don't need MINA at all.
And when I want to test the network layer, I prefer to use the real
stuff (ie using real sockets).

Maarten

On Thu, Nov 6, 2008 at 10:49 PM, Mark Webb <el...@gmail.com> wrote:
> I have never used it.  I could see it having a utility for unit
> testing, but that is it.
>
>
> On Thu, Nov 6, 2008 at 11:05 AM, Emmanuel Lecharny <el...@gmail.com> wrote:
>> peter royal wrote:
>>>
>>> On Nov 6, 2008, at 7:28 AM, Dan Creswell wrote:
>>>>
>>>> Hmmm, if VmPipe is done right it should allow me to build an app/service
>>>> on
>>>> top of MINA that can easily be tested all inside of a single JVM (good
>>>> for
>>>> unit testing amongst other things) or deployed fully networked with
>>>> minimum
>>>> code disruption.
>>>>
>>>> Is it intended to be used in such a fashion?  If not possibly it can be
>>>> dropped.
>>>
>>> I am using it for exactly this purpose.
>>>
>>> We have two services that can either be deployed as separate VMs, or
>>> inside of the same VM. WHen its inside the same VM, we cull out the protocol
>>> filters and just use a VmPipe. Minimal code disruption to support both
>>> configurations.
>>
>> Interesting. Edouard's proposal then makes sense : implementing the
>> underlying communication using Queues and removing a lot of the current code
>> could help.
>>
>> You will still have the same API (IoAcceptor/IoConnector), and won't be
>> disruptive.
>>
>> This has to be evaluated.
>>
>>
>> --
>> --
>> cordialement, regards,
>> Emmanuel Lécharny
>> www.iktek.com
>> directory.apache.org
>>
>>
>>
>

Re: poll VmPipe

Posted by Mark Webb <el...@gmail.com>.
I have never used it.  I could see it having a utility for unit
testing, but that is it.


On Thu, Nov 6, 2008 at 11:05 AM, Emmanuel Lecharny <el...@gmail.com> wrote:
> peter royal wrote:
>>
>> On Nov 6, 2008, at 7:28 AM, Dan Creswell wrote:
>>>
>>> Hmmm, if VmPipe is done right it should allow me to build an app/service
>>> on
>>> top of MINA that can easily be tested all inside of a single JVM (good
>>> for
>>> unit testing amongst other things) or deployed fully networked with
>>> minimum
>>> code disruption.
>>>
>>> Is it intended to be used in such a fashion?  If not possibly it can be
>>> dropped.
>>
>> I am using it for exactly this purpose.
>>
>> We have two services that can either be deployed as separate VMs, or
>> inside of the same VM. WHen its inside the same VM, we cull out the protocol
>> filters and just use a VmPipe. Minimal code disruption to support both
>> configurations.
>
> Interesting. Edouard's proposal then makes sense : implementing the
> underlying communication using Queues and removing a lot of the current code
> could help.
>
> You will still have the same API (IoAcceptor/IoConnector), and won't be
> disruptive.
>
> This has to be evaluated.
>
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>

Re: poll VmPipe

Posted by Emmanuel Lecharny <el...@gmail.com>.
peter royal wrote:
> On Nov 6, 2008, at 7:28 AM, Dan Creswell wrote:
>> Hmmm, if VmPipe is done right it should allow me to build an 
>> app/service on
>> top of MINA that can easily be tested all inside of a single JVM 
>> (good for
>> unit testing amongst other things) or deployed fully networked with 
>> minimum
>> code disruption.
>>
>> Is it intended to be used in such a fashion?  If not possibly it can be
>> dropped.
>
> I am using it for exactly this purpose.
>
> We have two services that can either be deployed as separate VMs, or 
> inside of the same VM. WHen its inside the same VM, we cull out the 
> protocol filters and just use a VmPipe. Minimal code disruption to 
> support both configurations.
Interesting. Edouard's proposal then makes sense : implementing the 
underlying communication using Queues and removing a lot of the current 
code could help.

You will still have the same API (IoAcceptor/IoConnector), and won't be 
disruptive.

This has to be evaluated.


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: poll VmPipe

Posted by peter royal <pr...@apache.org>.
On Nov 6, 2008, at 7:28 AM, Dan Creswell wrote:
> Hmmm, if VmPipe is done right it should allow me to build an app/ 
> service on
> top of MINA that can easily be tested all inside of a single JVM  
> (good for
> unit testing amongst other things) or deployed fully networked with  
> minimum
> code disruption.
>
> Is it intended to be used in such a fashion?  If not possibly it can  
> be
> dropped.

I am using it for exactly this purpose.

We have two services that can either be deployed as separate VMs, or  
inside of the same VM. WHen its inside the same VM, we cull out the  
protocol filters and just use a VmPipe. Minimal code disruption to  
support both configurations.

-pete

-- 
proyal@apache.org - http://fotap.org/~osi





Re: poll VmPipe

Posted by Dan Creswell <da...@gmail.com>.
Hmmm, if VmPipe is done right it should allow me to build an app/service on
top of MINA that can easily be tested all inside of a single JVM (good for
unit testing amongst other things) or deployed fully networked with minimum
code disruption.

Is it intended to be used in such a fashion?  If not possibly it can be
dropped.

On Thu, Nov 6, 2008 at 3:16 PM, Julien Vermillard <jv...@archean.fr>wrote:

> Hi,
>
> Do you use VmPipe ? Because more I look at it, more I feel like
> pressing "CTRL+A DEL".
>
> It's somewhat a lot of code for not a really frequent usage, if you
> want to send object in the same JVM, use a queue.
>
> Julien
>