libtcspc.RegulateTimeReached

final class libtcspc.RegulateTimeReached(interval_threshold, count_threshold, numeric_traits=None)[source]

Bases: Node

Processor that regulates the frequency of TimeReachedEvent.

Ensures that the event stream contains TimeReachedEvent at reasonable abstime intervals and event-count intervals, removing redundant ones based on the same criteria. Useful when sorting events from multiple streams by abstime downstream.

Parameters:
  • interval_threshold (int or Param[int]) – A TimeReachedEvent is emitted at the next opportunity if at least this abstime interval has elapsed since the previously emitted one. Use the maximum value of the abstime type to effectively disable the interval criterion.

  • count_threshold (int or Param[int]) – A TimeReachedEvent is emitted when this many events have been emitted since the previously emitted one.

  • numeric_traits (NumericTraits or None) – Numeric traits specifying abstime_type. Defaults to NumericTraits().

Notes

Events handled:

  • TimeReachedEvent: emit, possibly rate-limited.

  • All event types with an abstime field: pass through, possibly followed by a TimeReachedEvent.

  • End of input: emit a final TimeReachedEvent with the time of the last event passed; pass through.

See also

tcspc::regulate_time_reached()

The underlying C++ factory function.