Execution Contexts
¶
- Module
Execution Contexts are objects that wraps the stateless data-structures (graphs and nodes) during a job execution to keep an eye on their context/state (from the simplest things like i/o statistics to lifecycle and custom userland state).
-
class
GraphExecutionContext
(graph, plugins=None, services=None, dispatcher=None)[source]¶ Bases:
object
-
NodeExecutionContextType
¶ alias of
bonobo.execution.contexts.node.NodeExecutionContext
-
PluginExecutionContextType
¶ alias of
bonobo.execution.contexts.plugin.PluginExecutionContext
-
write
(*messages)[source]¶ Push a list of messages in the inputs of this graph’s inputs, matching the output of special node “BEGIN” in our graph.
-
TICK_PERIOD
= 0.25¶
-
alive
¶
-
started
¶
-
stopped
¶
-
-
class
NodeExecutionContext
(wrapped, *, parent=None, services=None, _input=None, _outputs=None)[source]¶ Bases:
bonobo.execution.contexts.base.BaseContext
,bonobo.util.statistics.WithStatistics
Node execution context has the responsibility fo storing the state of a transformation during its execution.
- Parameters
wrapped – wrapped transformation
parent – parent context, most probably a graph context
services – dict-like collection of services
_input – input queue (optional)
_outputs – output queues (optional)
-
start
()[source]¶ Starts this context, a.k.a the phase where you setup everything which will be necessary during the whole lifetime of a transformation.
The “ContextCurrifier” is in charge of setting up a decorating stack, that includes both services and context processors, and will call the actual node callable with additional parameters.
-
step
()[source]¶ A single step in the loop.
Basically gets an input bag, send it to the node, interpret the results.
-
write
(*messages)[source]¶ Push a message list to this context’s input queue.
- Parameters
value (mixed) – message
-
input_type
¶
-
output_type
¶