Created
July 30, 2022 09:23
-
-
Save wazum/01aa31453d54bef39aff6d737cd95007 to your computer and use it in GitHub Desktop.
Symfony Handle Message Middleware AckStamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
… | |
/** @var AckStamp $ackStamp */ | |
if ($batchHandler && $ackStamp = $envelope->last(AckStamp::class)) { | |
$ack = new Acknowledger(get_debug_type($batchHandler), static function (\Throwable $e = null, $result = null) use ($envelope, $ackStamp, $handlerDescriptor) { | |
if (null !== $e) { | |
$e = new HandlerFailedException($envelope, [$e]); | |
} else { | |
$envelope = $envelope->with(HandledStamp::fromDescriptor($handlerDescriptor, $result)); | |
} | |
$ackStamp->ack($envelope, $e); | |
}); | |
$result = $handler($message, $ack); | |
… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment