Ramps

class motorway.ramp.Ramp(runs_on_controller=False, process_uuid=None)[source]

All messages must at some point start at a ramp, which ingests data into the pipeline from an external system or generates data it self (such as random words in the tutorial)

failed(_id)[source]

Called when a message failed somewhere in the pipeline. The message might not be entirely finished processing at this point and this function might be called multiple times.

Parameters:_id – The id of the message that failed
next()[source]

This function is called continuously by the ramp.

Warning

Do not block this for a long time or make a while True loop inside it. Betwen every motorway.ramp.Ramp.next() run, some essential operations are run, including receiving acks from the motorway.controller.Controller

Yield:motorway.messages.Message instance
should_run()[source]
Subclass to define rules whether this tap should run or not. Mainly used for ensuring a tap only runs once
across the network
Returns:bool
success(_id)[source]

Called when a message was successfully ack’ed through the entire pipeline.

Parameters:_id – The id of the message that was successful