ReadTransport is an asyncio transport abstraction for receiving data from a readable operating-system resource. It separates data transmission from application behavior: the transport detects events, then calls methods on an asyncio.Protocol. section 8.2
The abstraction supports several practical operations:
- Receive data from sources such as sockets, standard input, and other file-like objects. section 8.2 section 8.4
- Deliver connection and data events to a protocol, which can respond through the transport. section 8.2
- Connect a protocol to standard input through connect_read_pipe and StreamReaderProtocol, enabling asynchronous readline calls. section 8.4
Non-blocking standard input
Create a StreamReader, wrap it in StreamReaderProtocol, and connect it to sys.stdin with loop.connect_read_pipe. Await stdin_reader.readline() while scheduling delay tasks, so user input does not block the event loop. section 8.4
Use the transport hierarchy to distinguish ReadTransport from WriteTransport and the combined Transport abstraction. section 8.2
