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/06/04 10:06:14 UTC

Re: IoSession.write() without WriteFuture

On Mon, 19 May 2008 11:13:21 +0300
Eero Nevalainen <ee...@indagon.com> wrote:

> Julien Vermillard wrote:
> > On Tue, 6 May 2008 14:27:06 +0300
> > "Cem Uzunlar" <ce...@gmail.com> wrote:
> > 
> >> Yes, it would definitely be a very good option.
> >>
> >> 2008/5/6 "이희승 (Trustin Lee) <tr...@gmail.com>:
> >>
> >>> Hi,
> >>>
> >>> There's an obvious situation that a user doesn't want WriteFuture
> >>> at all.  In such a case, we could save pretty much amount of
> >>> memory per each write request by not creating WriteFuture.
> >>>
> >>> Not sure if this will interfere with existing IoFilters though.
> >>> --
> >>> Trustin Lee - Principal Software Engineer, JBoss, Red Hat
> >>> --
> >>> what we call human nature is actually human habit
> >>> --
> >>> http://gleamynode.net/
> >>>
> >>>
> > 
> > So we can introduce
> > void write(..);
> > and
> > WriteFuture writeWithFuture(..);
> 
> or
> WriteFuture write(..);
> and
> void writeAndForget(..);
> 
> Depends on which is the default (I don't know so don't ask)
> 
> -Eero Nevalainen
> 

I think most of time you don't care of the WriteFuture, so in most of
case you don't have the WriteFuture object created and you consume less
memory.

I propose : 
void write(..) as default
and a
WriteFuture writeWithFuture(..);
or something else if someone got a better idea because I'm not sure to
have the best wording here ;)

WDYT ?
Julien

Re: AW: IoSession.write() without WriteFuture

Posted by Maarten Bosteels <mb...@gmail.com>.
On Fri, Jun 6, 2008 at 12:12 AM, Alex Karasulu <ak...@apache.org> wrote:
> On Thu, Jun 5, 2008 at 5:59 PM, Emmanuel Lecharny <el...@apache.org>
> wrote:
>
>> Maarten Bosteels wrote:
>>
>>> On Wed, Jun 4, 2008 at 3:45 PM, Emmanuel Lecharny <el...@apache.org>
>>> wrote:
>>>
>>>
>>>> Steve Ulrich wrote:
>>>>
>>>>
>>>>>
>>>>>
>>>>>> Julien Vermillard wrote
>>>>>>
>>>>>> On Wed, 04 Jun 2008 10:37:57 +0200
>>>>>> Emmanuel Lecharny <el...@apache.org> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Julien Vermillard wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> I propose :
>>>>>>>> void write(..) as default
>>>>>>>> and a
>>>>>>>> WriteFuture writeWithFuture(..);
>>>>>>>> or something else if someone got a better idea because I'm not sure
>>>>>>>> to have the best wording here ;)
>>>>>>>>
>>>>>>>> WDYT ?
>>>>>>>> Julien
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> Why not simply
>>>>>>>
>>>>>>> void write( ... )
>>>>>>>
>>>>>>> and
>>>>>>>
>>>>>>> WriteFuture writeFuture( ... ) ?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> damn I'm an idiot ;) how I can missed this solution.
>>>>>>
>>>>>>
>>>>>>
>>>>> If you don't want to break backward compatibility, perhaps something
>>>>> like:
>>>>> WriteFuture write(...)
>>>>> void writeAndForget(...)
>>>>>
>>>>>
>>>>>
>>>> We are targeting a 2.0 release, any version before a RC may be changed.
>>>> But
>>>> in order to avoid being stoned by users :), I would suggest to @deprecate
>>>> the previously used methods.
>>>>
>>>>
>>>
>>> I don't see how we can do that :
>>>
>>> before:
>>> WriteFuture write (Object message);
>>>
>>> after:
>>> void write (Object message);
>>> WriteFuture writeFuture (Object message);
>>>
>>> When we go for these method names, we can't keep the old (deprecated)
>>> signature since it only differs in return type.
>>>
>>> Or am I missng something ?
>>>
>>>
>> No, this was my mistake :)
>>
>> Do we care about breaking backward compatibility ?
>>
>
> I don't think it's that big of a deal going from 1.X - 2.0.  Things change.
> I'd just focus on making the API as coherent as possible.

+1

>
> Alex
>

Re: AW: IoSession.write() without WriteFuture

Posted by Alex Karasulu <ak...@apache.org>.
On Thu, Jun 5, 2008 at 5:59 PM, Emmanuel Lecharny <el...@apache.org>
wrote:

> Maarten Bosteels wrote:
>
>> On Wed, Jun 4, 2008 at 3:45 PM, Emmanuel Lecharny <el...@apache.org>
>> wrote:
>>
>>
>>> Steve Ulrich wrote:
>>>
>>>
>>>>
>>>>
>>>>> Julien Vermillard wrote
>>>>>
>>>>> On Wed, 04 Jun 2008 10:37:57 +0200
>>>>> Emmanuel Lecharny <el...@apache.org> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Julien Vermillard wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> I propose :
>>>>>>> void write(..) as default
>>>>>>> and a
>>>>>>> WriteFuture writeWithFuture(..);
>>>>>>> or something else if someone got a better idea because I'm not sure
>>>>>>> to have the best wording here ;)
>>>>>>>
>>>>>>> WDYT ?
>>>>>>> Julien
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> Why not simply
>>>>>>
>>>>>> void write( ... )
>>>>>>
>>>>>> and
>>>>>>
>>>>>> WriteFuture writeFuture( ... ) ?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> damn I'm an idiot ;) how I can missed this solution.
>>>>>
>>>>>
>>>>>
>>>> If you don't want to break backward compatibility, perhaps something
>>>> like:
>>>> WriteFuture write(...)
>>>> void writeAndForget(...)
>>>>
>>>>
>>>>
>>> We are targeting a 2.0 release, any version before a RC may be changed.
>>> But
>>> in order to avoid being stoned by users :), I would suggest to @deprecate
>>> the previously used methods.
>>>
>>>
>>
>> I don't see how we can do that :
>>
>> before:
>> WriteFuture write (Object message);
>>
>> after:
>> void write (Object message);
>> WriteFuture writeFuture (Object message);
>>
>> When we go for these method names, we can't keep the old (deprecated)
>> signature since it only differs in return type.
>>
>> Or am I missng something ?
>>
>>
> No, this was my mistake :)
>
> Do we care about breaking backward compatibility ?
>

I don't think it's that big of a deal going from 1.X - 2.0.  Things change.
I'd just focus on making the API as coherent as possible.

Alex

Re: AW: IoSession.write() without WriteFuture

Posted by Emmanuel Lecharny <el...@apache.org>.
Maarten Bosteels wrote:
> On Wed, Jun 4, 2008 at 3:45 PM, Emmanuel Lecharny <el...@apache.org> wrote:
>   
>> Steve Ulrich wrote:
>>     
>>>       
>>>> Julien Vermillard wrote
>>>>
>>>> On Wed, 04 Jun 2008 10:37:57 +0200
>>>> Emmanuel Lecharny <el...@apache.org> wrote:
>>>>
>>>>
>>>>         
>>>>> Julien Vermillard wrote:
>>>>>
>>>>>           
>>>>>> I propose :
>>>>>> void write(..) as default
>>>>>> and a
>>>>>> WriteFuture writeWithFuture(..);
>>>>>> or something else if someone got a better idea because I'm not sure
>>>>>> to have the best wording here ;)
>>>>>>
>>>>>> WDYT ?
>>>>>> Julien
>>>>>>
>>>>>>
>>>>>>             
>>>>> Why not simply
>>>>>
>>>>> void write( ... )
>>>>>
>>>>> and
>>>>>
>>>>> WriteFuture writeFuture( ... ) ?
>>>>>
>>>>>
>>>>>           
>>>> damn I'm an idiot ;) how I can missed this solution.
>>>>
>>>>         
>>> If you don't want to break backward compatibility, perhaps something like:
>>> WriteFuture write(...)
>>> void writeAndForget(...)
>>>
>>>       
>> We are targeting a 2.0 release, any version before a RC may be changed. But
>> in order to avoid being stoned by users :), I would suggest to @deprecate
>> the previously used methods.
>>     
>
> I don't see how we can do that :
>
> before:
> WriteFuture write (Object message);
>
> after:
> void write (Object message);
> WriteFuture writeFuture (Object message);
>
> When we go for these method names, we can't keep the old (deprecated)
> signature since it only differs in return type.
>
> Or am I missng something ?
>   
No, this was my mistake :)

Do we care about breaking backward compatibility ?

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



Re: AW: IoSession.write() without WriteFuture

Posted by Maarten Bosteels <mb...@gmail.com>.
On Wed, Jun 4, 2008 at 3:45 PM, Emmanuel Lecharny <el...@apache.org> wrote:
> Steve Ulrich wrote:
>>
>>
>>>
>>> Julien Vermillard wrote
>>>
>>> On Wed, 04 Jun 2008 10:37:57 +0200
>>> Emmanuel Lecharny <el...@apache.org> wrote:
>>>
>>>
>>>>
>>>> Julien Vermillard wrote:
>>>>
>>>>>
>>>>> I propose :
>>>>> void write(..) as default
>>>>> and a
>>>>> WriteFuture writeWithFuture(..);
>>>>> or something else if someone got a better idea because I'm not sure
>>>>> to have the best wording here ;)
>>>>>
>>>>> WDYT ?
>>>>> Julien
>>>>>
>>>>>
>>>>
>>>> Why not simply
>>>>
>>>> void write( ... )
>>>>
>>>> and
>>>>
>>>> WriteFuture writeFuture( ... ) ?
>>>>
>>>>
>>>
>>> damn I'm an idiot ;) how I can missed this solution.
>>>
>>
>> If you don't want to break backward compatibility, perhaps something like:
>> WriteFuture write(...)
>> void writeAndForget(...)
>>
>
> We are targeting a 2.0 release, any version before a RC may be changed. But
> in order to avoid being stoned by users :), I would suggest to @deprecate
> the previously used methods.

I don't see how we can do that :

before:
WriteFuture write (Object message);

after:
void write (Object message);
WriteFuture writeFuture (Object message);

When we go for these method names, we can't keep the old (deprecated)
signature since it only differs in return type.

Or am I missng something ?

Maarten

>
> And add a decent documentation + howto + FAQ ;)
>
> Any help warmly welcome !
>
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>

Re: AW: IoSession.write() without WriteFuture

Posted by Emmanuel Lecharny <el...@apache.org>.
Steve Ulrich wrote:
>   
>> Julien Vermillard wrote
>>
>> On Wed, 04 Jun 2008 10:37:57 +0200
>> Emmanuel Lecharny <el...@apache.org> wrote:
>>
>>     
>>> Julien Vermillard wrote:
>>>       
>>>> I propose :
>>>> void write(..) as default
>>>> and a
>>>> WriteFuture writeWithFuture(..);
>>>> or something else if someone got a better idea because I'm not sure
>>>> to have the best wording here ;)
>>>>
>>>> WDYT ?
>>>> Julien
>>>>
>>>>         
>>> Why not simply
>>>
>>> void write( ... )
>>>
>>> and
>>>
>>> WriteFuture writeFuture( ... ) ?
>>>
>>>       
>> damn I'm an idiot ;) how I can missed this solution.
>>     
>
> If you don't want to break backward compatibility, perhaps something like:
> WriteFuture write(...)
> void writeAndForget(...)
>   
We are targeting a 2.0 release, any version before a RC may be changed. 
But in order to avoid being stoned by users :), I would suggest to 
@deprecate the previously used methods.

And add a decent documentation + howto + FAQ ;)

Any help warmly welcome !


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



AW: IoSession.write() without WriteFuture

Posted by Steve Ulrich <st...@proemion.com>.

> Julien Vermillard wrote
>
> On Wed, 04 Jun 2008 10:37:57 +0200
> Emmanuel Lecharny <el...@apache.org> wrote:
>
> > Julien Vermillard wrote:
> > > I propose :
> > > void write(..) as default
> > > and a
> > > WriteFuture writeWithFuture(..);
> > > or something else if someone got a better idea because I'm not sure
> > > to have the best wording here ;)
> > >
> > > WDYT ?
> > > Julien
> > >
> > Why not simply
> >
> > void write( ... )
> >
> > and
> >
> > WriteFuture writeFuture( ... ) ?
> >
>
> damn I'm an idiot ;) how I can missed this solution.

If you don't want to break backward compatibility, perhaps something like:
WriteFuture write(...)
void writeAndForget(...)

regards


Re: IoSession.write() without WriteFuture

Posted by Julien Vermillard <jv...@archean.fr>.
On Wed, 04 Jun 2008 10:37:57 +0200
Emmanuel Lecharny <el...@apache.org> wrote:

> Julien Vermillard wrote:
> > I propose : 
> > void write(..) as default
> > and a
> > WriteFuture writeWithFuture(..);
> > or something else if someone got a better idea because I'm not sure
> > to have the best wording here ;)
> >
> > WDYT ?
> > Julien
> >   
> Why not simply
> 
> void write( ... )
> 
> and
> 
> WriteFuture writeFuture( ... ) ?
> 

damn I'm an idiot ;) how I can missed this solution.

Re: IoSession.write() without WriteFuture

Posted by Emmanuel Lecharny <el...@apache.org>.
Julien Vermillard wrote:
> I propose : 
> void write(..) as default
> and a
> WriteFuture writeWithFuture(..);
> or something else if someone got a better idea because I'm not sure to
> have the best wording here ;)
>
> WDYT ?
> Julien
>   
Why not simply

void write( ... )

and

WriteFuture writeFuture( ... ) ?

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