List Info

Thread: Selector




Selector
user name
2006-09-30 15:54:39
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?

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?

cheers,
  Roland


------------------------------------------------------------
---------
To unsubscribe, e-mail: httpclient-dev-unsubscribejakarta.apache.org
For additional commands, e-mail: httpclient-dev-helpjakarta.apache.org

Selector
user name
2006-10-01 18:33:33
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-unsubscribejakarta.apache.org
> For additional commands, e-mail:
httpclient-dev-helpjakarta.apache.org
> 
> 


------------------------------------------------------------
---------
To unsubscribe, e-mail: httpclient-dev-unsubscribejakarta.apache.org
For additional commands, e-mail: httpclient-dev-helpjakarta.apache.org

Selector
user name
2006-10-02 07:01:01
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-unsubscribejakarta.apache.org
For additional commands, e-mail: httpclient-dev-helpjakarta.apache.org

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )