libtcspc.Acquire

final class libtcspc.Acquire(event_type, reader, buffer_provider, batch_size, access_tag)[source]

Bases: Node

Source processor that acquires data into buckets via a pull-style reader.

Used to plug a hardware acquisition driver — or any pull-based data source — into a libtcspc processing graph. On each iteration the processor obtains an empty bucket from the buffer provider, calls the reader to fill it, and emits the (possibly partially filled) bucket as a BucketEvent downstream.

The acquisition runs until the reader signals end of stream (by returning None), the reader raises an exception, or the acquisition is halted via the AcquireAccessor retrieved from the ExecutionContext using access_tag. Halting is asynchronous: the halt() call returns immediately, but the acquisition may continue briefly. Wait for graph execution to finish before tearing down resources used by the reader.

Parameters:

Notes

Events handled:

  • This processor has no input events; it is a source.

  • Emits BucketEvent of event_type whenever a non-empty read completes.

  • End of input is initiated when the reader returns None, whereupon the downstream is flushed. If halted via AcquireAccessor before end of stream, the downstream is not flushed and a halt exception is raised.

See also

tcspc::acquire()

The underlying C++ factory function.

AcquisitionReader

Interface for built-in C++-side readers.

PyAcquisitionReader

Interface for Python-callable readers (used via Param).

AcquireAccessor

Runtime accessor providing halt().