titanfe.brick module

Abstract base classes for building Bricks

class titanfe.brick.BrickBase(adapter: titanfe.apps.brick_runner.adapter.BrickAdapter, parameters: Optional[Dict] = None)[source]

Bases: object

An abstract base class for building Bricks

abstract process(input: Type[ujotypes.variants.base.UjoBase], port: str)[source]

Do the input processing.

To modify the payload of the current packet simply return a new value. Use the adapter’s emit_new_packet to create a data packet and insert it into the flow.

Parameters:

input (Type[UjoBase]) – the input data to be processed

Returns:

the new payload for current data packet traveling in the flow. When returning None the current packet get’s dropped.

Return type:

Optional[UjoBase]

setup()[source]

Upon loading the Brick in the BrickRunner the setup-method is run once and can be used to e.g. open connections that will be held persistent.

teardown()[source]

When unloading the Brick from the BrickRunner the teardown-method is run once, implement it to e.g. close connections opened during setup

exception titanfe.brick.ConfigurationError[source]

Bases: Exception

class titanfe.brick.InletBrickBase(adapter: titanfe.apps.brick_runner.adapter.BrickAdapter, parameters: Optional[Dict] = None)[source]

Bases: titanfe.brick.BrickBase

An abstract base class for building bricks that will run a continous process

abstract stop_processing()[source]

The BrickRunner needs a way to properly end continuously running bricks. It will call this method upon receiving a termination request and expect the processing to be aborted/terminated.