- Overview
- EventStream
EventStream
Part of Event streams in the Python API reference.
Related guidance: quickstarts/observe-data, how-to/observe-mesh-data.
Runnable examples: watch_tracks.py, observe_mesh_data.py.
from picogrid_ecn_client import EventStreamIterate a bounded local queue of typed MQTT events.
class EventStream(AsyncIterator[EventT], Generic[EventT]): ...Consume EventStream with async for and close it asynchronously when needed.
buffer_size
Section titled “buffer_size”Return the fixed positive local queue size.
buffer_size: intdelivery_policy
Section titled “delivery_policy”Return the local full-queue delivery policy.
delivery_policy: DeliveryPolicydropped_count
Section titled “dropped_count”Return decoded events dropped from this stream’s bounded buffer.
dropped_count: intdecode_error_count
Section titled “decode_error_count”Return the number of matching payloads rejected by this decoder.
decode_error_count: intclosed
Section titled “closed”Return whether close has begun and further delivery is disabled.
closed: bool__aiter__
Section titled “__aiter__”Return this stream as its asynchronous iterator.
def __aiter__() -> EventStream[EventT]__anext__
Section titled “__anext__”Return the next queued event, waiting until one arrives.
async def __anext__() -> EventTaclose
Section titled “aclose”Close the stream idempotently.
async def aclose() -> NoneRaises
Section titled “Raises”| Exception | Description |
|---|---|
| AuthorizationError | If the broker rejects the unsubscribe issued when this was the last local consumer of a filter. |
| ProtocolError | If the broker returns a malformed UNSUBACK. |
| ConnectionError | If the transport fails while unsubscribing. |
Version 0.2.0 · branch main
