pybotters.WebSocketQueue

class pybotters.WebSocketQueue(maxsize=0, *, loop=<object object>)

WebSocket queue (from asyncio.Queue).

Methods

__init__([maxsize, loop])

empty()

Return True if the queue is empty, False otherwise.

full()

Return True if there are maxsize items in the queue.

get()

Remove and return an item from the queue.

get_nowait()

Remove and return an item from the queue.

join()

Block until all items in the queue have been gotten and processed.

onmessage(msg, ws)

WebSocket message hander callback.

put(item)

Put an item into the queue.

put_nowait(item)

Put an item into the queue without blocking.

qsize()

Number of items in the queue.

task_done()

Indicate that a formerly enqueued task is complete.

Attributes

maxsize

Number of items allowed in the queue.

onmessage(msg: Any, ws: ClientWebSocketResponse)

WebSocket message hander callback.