[Python-3000] revamping the io stack, part 2

Robin Bryce robinbryce at gmail.com
Sun Apr 30 23:37:40 CEST 2006


>>     def async_read(self, count, callback)
>>     def async_write(self, data, callback)

>I think many people would be happy if the proposal would use the
>Deferred abstraction which is built in Twisted. :-)

 I almost agree. Not sure whether a Defered implementation in python core
would be preferable to:

def async_read(self, count, callback, errback=None)
def async_write(self, data, callback, errback=None)

The addition of the errback, which need not be specified, would be
sufficient to hook into twisted defereds, or any other implementation of
that pattern. If errback is None I would expect the exception to be passed
as the result for callback.

Alternately, if callback was a generator instance, it could be 'resumed'
with the exception and we could forget all about defereds/errbacks. If
practical, this would definitely get +1 from me.

Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20060430/90282fc3/attachment.htm 


More information about the Python-3000 mailing list