Skip to content

observe_mesh_data

Part of Reusable workflows in the Python API reference.

Related guidance: shipped-tooling.

Runnable examples: observe_mesh_data.py.

from picogrid_ecn_client.workflows import observe_mesh_data

Observe routed entity and location families until either consumer completes.

async def observe_mesh_data(
client: ECNClient,
*,
integrations: Collection[str],
limit: int = 0,
on_event: Callable[[EntityEvent | LocationEvent], None] | None = None,
) -> MeshObservationResult
NameTypeDefaultDescription
clientECNClientConfigured SDK client used to open both public streams.
integrationsCollection[str]Exact integration names allowed on both streams.
limitint0Maximum events per consumer; zero watches until interrupted while retaining only the most recent configured watcher buffer per consumer.
on_eventCallable[[EntityEvent | LocationEvent], None] | NoneNoneOptional synchronous callback invoked for every observed event.
TypeDescription
MeshObservationResultAll events from positive-limit consumers, or the most recently retained events from unbounded consumers, before either consumer completed.
ExceptionDescription
ValidationErrorIf limit is negative, integrations is empty, or an integration name is empty.
ECNClientErrorIf either stream cannot be opened or consumed.

Source · workflows/observe.py

Version 0.2.0 · branch main