DeduplicatingDispatcher
in package
implements
NotificationDispatcherInterface
FinalYes
Decorator that drops repeated notifications with the same signature within a configurable TTL window. Cache is in-process; horizontally-scaled deployments should swap this for a Redis-backed equivalent (adapter packages may provide one).
Table of Contents
Interfaces
Methods
- __construct() : mixed
- dispatch() : void
Methods
__construct()
public
__construct(NotificationDispatcherInterface $inner[, int $ttlSeconds = 1800 ][, callable(): int|null $clock = null ]) : mixed
Parameters
- $inner : NotificationDispatcherInterface
- $ttlSeconds : int = 1800
- $clock : callable(): int|null = null
-
Injectable now() for deterministic tests; defaults to time().
dispatch()
public
dispatch(Notification $notification) : void
Parameters
- $notification : Notification
Attributes
- #[Override]