You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2006/10/01 20:33:33 UTC

Re: [HttpCore.NIO] Selector

On Sat, 2006-09-30 at 17:54 +0200, Roland Weber wrote:
> Hi Oleg,
> 
> I am wondering whether we should define a more granular lifecycle
> for an IOReactor. More specifically, whether we should introduce
> a prepare() or initialize() method, after which the Selector for
> the IOReactor is known to exist. And maybe a cleanup() or destroy()
> method to be called after execute() returns?
> 

Roland,

I will be doing a lot of work on HttpCore NIO in the coming weeks, so
IOReactor is very likely to undergo some major changes. Please do feel
free to add more methods to the interface and/or the impl class if you
think something is missing.

> To better integrate with NIO functionality, we could also add
> getSelector() to the IOReactor interface and getSelectionKey()
> to the IOSession interface. Does the latter make sense?
> 

I do not know. I suspect direct manipulation of SelectionKey and
Selector is very likely to break implementations of those interfaces. I
would probably avoid exposing low level NIO primitives unless we have a
very strong case for doing otherwise.

Oleg


> cheers,
>   Roland
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Re: [HttpCore.NIO] Selector

Posted by Roland Weber <ht...@dubioso.net>.
Hi Oleg,

> I will be doing a lot of work on HttpCore NIO in the coming weeks, so
> IOReactor is very likely to undergo some major changes. Please do feel
> free to add more methods to the interface and/or the impl class if you
> think something is missing.

I won't have time to do implementation work there.

>>To better integrate with NIO functionality, we could also add
>>getSelector() to the IOReactor interface and getSelectionKey()
>>to the IOSession interface. Does the latter make sense?
> 
> I do not know. I suspect direct manipulation of SelectionKey and
> Selector is very likely to break implementations of those interfaces. I
> would probably avoid exposing low level NIO primitives unless we have a
> very strong case for doing otherwise.

If I understood the API correctly, something must be registered
with a Selector so that the IOReactor gets any events to be
handled at all. On the other hand, that could be done by
implementation specific reactor methods rather than by exposing
the Selector in the interface. I'll wait and see how things
shape up in the future.

cheers,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org