ait.core.server.handler module

class ait.core.server.handler.Handler(input_type=None, output_type=None, **kwargs)

Bases: object

This is the base Handler class that all custom handlers must inherit from. All custom handlers must implement the handle method, which will called by the stream the handler is attached to when the stream receives data.

__init__(input_type=None, output_type=None, **kwargs)
Params:
input_type: (optional) Specifies expected input type, used to
validate handler workflow. Defaults to None.
output_type: (optional) Specifies expected output type, used to
validate handler workflow. Defaults to None

**kwargs: (optional) Requirements dependent on child class.

handle(input_data)

Not implemented by base Handler class. This handle method must be implemented by any custom handler class that inherits from this base Handler.

Params:
input_data: If this is a stream’s first handler, the input_data will
be the message received by the stream. Otherwise it will be the output of the previous handler.