libtcspc.ExecutionContext

class libtcspc.ExecutionContext(compiled_graph, arguments=None, downstreams=None)[source]

Bases: object

An execution context for a compiled processing graph.

This object encapsulates a single run of stream processing and cannot be reused.

Parameters:
  • compiled_graph (CompiledGraph) – The compiled graph from which to instantiate the processor.

  • arguments (dict[str, Any] or None) – The values that parameters should bind to, keyed by Param name. None (the default) means all parameters use their defaults.

  • downstreams (Sequence[PySink] | None)

access(tag)[source]

Obtain run-time access to components of the processing graph.

Parameters:

tag (AccessTag) – The access tag.

Returns:

The access object for the requested tag. The concrete protocol (e.g., AcquireAccess, CountAccess) depends on the node type that was tagged.

Return type:

Access

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