Author vstinner
Recipients Paulo Costa, gvanrossum, martin.panter, vstinner, yselivanov
Date 2016-02-03.08:16:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454487379.49.0.949424609616.issue26270@psf.upfronthosting.co.za>
In-reply-to
Content
Paulo Costa:
> async def async_read(fd. n):

This method already exists:
* (TCP) https://docs.python.org/dev/library/asyncio-protocol.html#asyncio.Protocol.data_received
* (UDP) https://docs.python.org/dev/library/asyncio-protocol.html#asyncio.DatagramProtocol.datagram_received
* (TCP) https://docs.python.org/dev/library/asyncio-stream.html#asyncio.StreamReader.read


Martin Panter:
> last time I looked they all seemed to buffer your write data and send it in the background. E.g. in the echo-client-using-streams example, there is a writer.write() call that does not use “yield from”. Does asyncio have an easy way for a coroutine to write to a socket (or file descriptor) and block (suspend the coroutine) until the write has finished

Sure, you must call https://docs.python.org/dev/library/asyncio-stream.html#asyncio.StreamWriter.drain
History
Date User Action Args
2016-02-03 08:16:19vstinnersetrecipients: + vstinner, gvanrossum, martin.panter, yselivanov, Paulo Costa
2016-02-03 08:16:19vstinnersetmessageid: <1454487379.49.0.949424609616.issue26270@psf.upfronthosting.co.za>
2016-02-03 08:16:19vstinnerlinkissue26270 messages
2016-02-03 08:16:19vstinnercreate