PendingPayloadBuffer constructor
PendingPayloadBuffer({
- required void onDrop(
- CEPTriggerPayload trigger,
- DropReason reason
- bool arrivalOrder = false,
- DateTime now()?,
- Timer createTimer(
- Duration delay,
- void callback()
Creates a buffer. onDrop settles a removed trigger with the CEP.
arrivalOrder flushes oldest first, for known-inline triggers. now and
createTimer replace the clock in tests.
Implementation
PendingPayloadBuffer({
required void Function(CEPTriggerPayload trigger, DropReason reason) onDrop,
bool arrivalOrder = false,
DateTime Function()? now,
Timer Function(Duration delay, void Function() callback)? createTimer,
}) : _onDrop = onDrop,
_arrivalOrder = arrivalOrder,
_now = now ?? DateTime.now,
_createTimer = createTimer ?? Timer.new;