Skip to content

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 EventStream

Iterate a bounded local queue of typed MQTT events.

class EventStream(AsyncIterator[EventT], Generic[EventT]): ...

Source · streams.py

Consume EventStream with async for and close it asynchronously when needed.

Return the fixed positive local queue size.

buffer_size: int

Source · streams.py

Return the local full-queue delivery policy.

delivery_policy: DeliveryPolicy

Source · streams.py

Return decoded events dropped from this stream’s bounded buffer.

dropped_count: int

Source · streams.py

Return the number of matching payloads rejected by this decoder.

decode_error_count: int

Source · streams.py

Return whether close has begun and further delivery is disabled.

closed: bool

Source · streams.py

Return this stream as its asynchronous iterator.

def __aiter__() -> EventStream[EventT]

Source · streams.py

Return the next queued event, waiting until one arrives.

async def __anext__() -> EventT

Source · streams.py

Close the stream idempotently.

async def aclose() -> None
ExceptionDescription
AuthorizationErrorIf the broker rejects the unsubscribe issued when this was the last local consumer of a filter.
ProtocolErrorIf the broker returns a malformed UNSUBACK.
ConnectionErrorIf the transport fails while unsubscribing.

Source · streams.py

Version 0.2.0 · branch main