netty/netty — Issue #67: Abstract event loop that implements ScheduledExecutorService
Author: trustin
Created: 2011-11-18 00:49:21+00:00
State: open
Labels: feature

Let's make all event (I/O) loop implement `ScheduledExecutorService` so that people can run their task in the I/O worker thread. Because it's going to be provided by all transports, we should introduce a transport-agnostic abstract event loop implementation.

Here's the current idea:

SocketChannel ch = ...;
NioEventLoop el = ...;
el.attach(ch);
...
el.schedule*(...); // from any thread, maybe from your handler
...
ch.detach(); // when you want to suspend I/O completely.

This also opens the possibility of letting user use a `java.nio.channels.SocketChannel` instance not created by Netty.