InMemoryBroker constructor
InMemoryBroker({})
Creates an in-memory broker with configurable timing defaults.
Implementation
InMemoryBroker({
this.namespace = 'stem',
this.delayedInterval = const Duration(milliseconds: 200),
this.claimInterval = const Duration(seconds: 5),
this.defaultVisibilityTimeout = const Duration(seconds: 30),
}) {
_namespaceRefs[namespace] = (_namespaceRefs[namespace] ?? 0) + 1;
_delayedTimer = Timer.periodic(
delayedInterval,
(_) => _drainDelayed(stemNow()),
);
_claimTimer = Timer.periodic(
claimInterval,
(_) => _reclaimExpired(stemNow()),
);
}