Skip to content

Broker

Broker

Bases: ABC

Abstract implementation of a broker.

A broker allows both to subscribe to a data stream and to publish events to a data stream.

connect(data_stream) async

Connects to the broker running in StreamPipes.

PARAMETER DESCRIPTION
data_stream

Contains the meta information (resources) for a data stream.

TYPE: DataStream

RETURNS DESCRIPTION
None

createSubscription() async abstractmethod

Creates a subscription to a data stream.

RETURNS DESCRIPTION
None

disconnect() async abstractmethod

Closes the connection to the server.

RETURNS DESCRIPTION
None

get_message() abstractmethod

Get the published messages of the subscription.

RETURNS DESCRIPTION
iterator

An async iterator for the messages.

TYPE: AsyncIterator

publish_event(event) async abstractmethod

Publish an event to a connected data stream.

PARAMETER DESCRIPTION
event

The event to be published.

TYPE: Dict[str, Any]

RETURNS DESCRIPTION
None