Message388895
I propose the addition of the following methods to asyncio.StreamReader:
> coroutine peek(n=-1)
> Same as read, but does not remove the returned data from the internal buffer.
>
> coroutine peekexactly(n)
> Same as readexactly, but does not remove the returned data from the internal buffer.
My use case is to multiplex a few protocols over a single TCP socket, for which I need to non-destructively read a few bytes from the socket to decide which parser to hand the stream over to.
Thoughts? |
|
Date |
User |
Action |
Args |
2021-03-16 23:51:15 | awalgarg | set | recipients:
+ awalgarg, asvetlov, yselivanov |
2021-03-16 23:51:15 | awalgarg | set | messageid: <1615938675.3.0.818734595532.issue43524@roundup.psfhosted.org> |
2021-03-16 23:51:15 | awalgarg | link | issue43524 messages |
2021-03-16 23:51:15 | awalgarg | create | |
|