room._RoomReader
Reads a room socket until its outbox gives up on the recipient.
Reads a room socket until its outbox gives up on the recipient.
The first receive() binds the reader to the task calling it and starts
one watcher, which interrupts that task if it is parked in receive()
when the outbox gives up; otherwise the next read sees it.
Functions
func__init__(self, websocket, abandoned) -> NonePrepare to read websocket.
paramselfparamwebsocketWebSocketThe room socket to read from.
paramabandonedasyncio.EventSet once the connection should no longer be served.
Returns
Nonefunc_watch(self, handler) -> NoneCancel the handler's pending read once the outbox gives up.
paramselfparamhandlerasyncio.Task[Any]Returns
Nonefuncreceive(self) -> Optional[Message]Receive the next message.
Raises
RuntimeError: When called from a task other than the first caller's.
paramselfReturns
typing.OptionalThe message, or None once the outbox has given up on this socket.
funcclose(self) -> NoneStop watching.
paramselfReturns
None