On Mon, 15 Oct 2012 14:11:07 +0100 Richard Oudkerk <shibturn@gmail.com> wrote:
One could use IOCP or select/poll/... to implement an API which looks like
class AsyncHub: def read(self, fd, nbytes): """Return future which is ready when read is complete"""
def write(self, fd, buf): """Return future which is ready when write is complete"""
def accept(self, fd): """Return future which is ready when connection is accepted"""
def connect(self, fd, address): """Return future which is ready when connection has succeeded"""
def wait(self, timeout=None): """Wait till a future is ready; return list of ready futures"""
A reactor could then be built on top of such a hub.
I suppose the reactor would handle higher-level stuff such as TLS? Regards Antoine.