Skip to content

Function handler

FunctionHandler(registration, client)

The function handler manages the StreamPipes Functions.

It controls the connection to the brokers, starts the functions, manages the broadcast of the live data and is able to stop the connection to the brokers and functions.

PARAMETER DESCRIPTION
registration

The registration, that contains the StreamPipesFunctions.

TYPE: Registration

client

The client to interact with the API.

TYPE: StreamPipesClient

ATTRIBUTE DESCRIPTION
stream_contexts

Map of all data stream contexts

TYPE: Dict[str, DataStreamContext]

brokers

List of all registered brokers

TYPE: List[Broker]

disconnect()

Disconnects from the brokers and stops all functions.

RETURNS DESCRIPTION
None

force_stop_functions()

Stops the StreamPipesFunctions when the event loop was stopped without stopping the functions.

RETURNS DESCRIPTION
None
WARNS DESCRIPTION
UserWarning

If there is a running event loop and the functions should be stopped by disconnecting from the broker.

initializeFunctions()

Creates the context for every data stream and starts the event loop to manage the StreamPipes Functions.

RETURNS DESCRIPTION
None