>>     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

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to