libtcspc.ExecutionContext¶
- class libtcspc.ExecutionContext(compiled_graph, arguments=None, downstreams=None)[source]¶
Bases:
objectAn execution context for a compiled processing graph.
This object encapsulates a single run of stream processing and cannot be reused.
- Parameters:
- access(tag)[source]¶
Obtain run-time access to components of the processing graph.
- Parameters:
tag (AccessTag) – The access tag.
- Returns:
The accessor for the requested tag. The concrete protocol (e.g.,
AcquireAccessor,CountAccessor) depends on the node type that was tagged.- Return type:
- cpp_to_graphviz()[source]¶
Return a Graphviz dot representation of the compiled C++ processor graph.
Unlike
Graph.to_graphviz, which describes the Python-side graph before compilation, this method introspects the actual C++ processor graph that was instantiated by code generation. Convenience helpers (such asread_events_from_binary_file) andSubgraphnodes are fully expanded.The output is intended for debugging and visualization only. The exact format is not stable and should not be consumed programmatically.
- Returns:
A complete
digraph G { ... }block in Graphviz DOT format.- Return type:
Notes
Safe to call at any point during the context’s lifetime: before
handle(), between calls, or afterflush()/EndOfProcessing. The method does not interact with the processor’s end-of-life state (consistent withaccess()).
- flush()[source]¶
Flush the processor input.
- Raises:
EndOfProcessing – If the processor detected the end of the stream (of interest).
- Return type:
None
- handle(event)[source]¶
Send an event to the processor input.
- Parameters:
event (Any) – The event.
- Raises:
EndOfProcessing – If the processor detected the end of the stream (of interest).
- Return type:
None