libtcspc.ProcessInBatches

final class libtcspc.ProcessInBatches(event_type, batch_size)[source]

Bases: Node

Processor that buffers a single event type into fixed-size batches and re-emits it.

Collects every batch_size events of event_type into a bucket and then re-emits them individually downstream. This is useful for decoupling upstream and downstream processing, but introduces latency.

Parameters:
  • event_type (EventType) – The event type to buffer. The input event set must consist only of this type.

  • batch_size (int or Param[int]) – Number of events to collect in each batch.

Notes

Events handled:

  • Events matching event_type: buffered and re-emitted unchanged.

  • All other event types: rejected at graph build time.

  • End of input: emit any buffered events, then pass through.

See also

tcspc::process_in_batches()

The underlying C++ factory function.