pylabrobot.hamilton.transport.tcp.EventSubscription#

class pylabrobot.hamilton.transport.tcp.EventSubscription(capacity: int, overflow: Literal['error', 'drop_oldest', 'drop_newest'], on_close: Callable[[EventSubscription], None])#

Bases: AsyncIterator[CommandResponse]

Consume events in arrival order on the connection’s event loop.

Use async with client.events() as events followed by async for event in events. The default overflow policy closes the subscription with an error. Explicit drop policies count discarded events in dropped. Stopping the session discards queued events and ends iteration; connection failure raises its error. Each subscription supports one consuming task at a time.

Parameters: