Skip to content

Async iter handler

AsyncIterHandler

Handles asynchronous iterators to get every message after another in parallel.

anext(stream_id, message) async staticmethod

Gets the next message from an AsyncIterator.

PARAMETER DESCRIPTION
stream_id

The id of the data stream which the message belongs to.

TYPE: str

message

An asynchronous iterator that contains the messages.

TYPE: AsyncIterator

RETURNS DESCRIPTION
result

Tuple of the stream id und next message or ("stop", None) if no message is left.

TYPE: Tuple[str, Optional[Any]]

combine_async_messages(messages) async staticmethod

Continuously gets the next published message from multiple AsyncIterators in parallel.

PARAMETER DESCRIPTION
messages

A dictionary with an asynchronous iterator for every stream id.

TYPE: Dict[str, AsyncIterator]

YIELDS DESCRIPTION
message

Description of the anonymous integer return value.

TYPE: Tuple[str, Any]