Routing

Direct Source

class DirectSource(app, pipeline, id=None, config=None)[source]

Bases: Source

Description: This source processes inserted event synchronously.


DirectSource.__init__()[source]

Description:


Direct Source

DirectSource.put(context, event, copy_context=False, copy_event=False)[source]

This method serves to put events into the pipeline and process them right away.

Context can be an empty dictionary if is not provided.


async DirectSource.main()[source]

Description:


Internal Source

class InternalSource(app, pipeline, id=None, config=None)[source]

Bases: Source

Description:


InternalSource.__init__()[source]

Description:


Internal Source methods

InternalSource.put(context, event, copy_context=False, copy_event=False)[source]

Description: Context can be an empty dictionary if is not provided.

If you are getting a asyncio.queues.QueueFull exception, you likely did not implemented backpressure handling. The simpliest approach is to use RouterSink / RouterProcessor.


async InternalSource.put_async(context, event, copy_context=False, copy_event=False)[source]

Description: This method allows to put an event into InternalSource asynchronously. Since a processing in the pipeline is synchronous, this method is useful mainly for situation, when an event is created outside of the pipeline processing. It is designed to handle situation when the queue is becoming full.

Context can be an empty dictionary if is not provided.


async InternalSource.main()[source]

Description:


InternalSource.rest_get()[source]

Description:

Returns

rest


Router Mix In

class RouterMixIn[source]

Bases: object

Description: Router Mix in a class


RouterMixIn.__init__()

Router Mix In methods

RouterMixIn.locate(source_id)[source]

Description:

Returns

source


RouterMixIn.unlocate(source_id)[source]

Description: Undo locate() call, it means that it removes the source from a cache + remove throttling binds

Returns

??


RouterMixIn.dispatch(context, event, source_id, copy_event=True)[source]

Description:

Returns

self.route(context, event, source_id, copy_event=True)


RouterMixIn.route(context, event, source_id, copy_event=True)[source]

Description: This method routes an event to a InternalSource source_id.

It can be called multiple times from a process() method, which results in a cloning of the event.


Router Sink

class RouterSink(app, pipeline, id=None, config=None)[source]

Bases: Sink, RouterMixIn

Description: Abstract Sink that dispatches events to other internal sources. One should override the process() method and call route() with target source id.


RouterSink.__init__()[source]

Initializes the Parameters

Parameters

appobject

Application object.

pipelinePipeline

Name of the Pipeline.

idstr, default=None,

ID of the class of config.

configJSON, or other compatible formats, default=None

Configuration file.

Router Processor

class RouterProcessor(app, pipeline, id=None, config=None)[source]

Bases: Processor, RouterMixIn

Description: Abstract Processor that dispatches events to other internal sources. One should override the process() method and call route() with target source id.


RouterProcessor.__init__()[source]

Description: