Hello, I've been playing with some asyncio-related ideas and a question came up about using coroutines in the data_received method of asyncio Protocols.
Here's a simple port of Twisted's IntNStringReceiverProtocol for asyncio: https://github.com/eliben/python3-samples/blob/master/async/asyncio-len-prefixed-string-protocol.py It's pretty straightforward, but it bothers me that data_received has to essentially manage a state machine, whereas I'd expect to be able to use coroutines there to just say something like the following in a loop: ... got length word ... now get 'length' bytes [yield from....] ... dispatch "string_received" Is this possible? Thanks in advance, Eli
