public function __invoke(EarlyExpirationMessage
$message) { $item =
$message->
getItem();
$metadata =
$item->
getMetadata();
$expiry =
$metadata[CacheItem::METADATA_EXPIRY
] ?? 0;
$ctime =
$metadata[CacheItem::METADATA_CTIME
] ?? 0;
if ($expiry &&
$ctime) { // skip duplicate or expired messages
$processingNonce =
[$expiry,
$ctime];
$pool =
$message->
getPool();
$key =
$item->
getKey();
if (($this->processedNonces
[$pool][$key] ?? null
) ===
$processingNonce) { return;
} if (microtime(true
) >=
$expiry) { return;
} $this->processedNonces
[$pool] =
[$key =>
$processingNonce] +
($this->processedNonces
[$pool] ??
[]);