$batchHandler =
$handlerDescriptor->
getBatchHandler();
/** @var AckStamp $ackStamp */
if ($batchHandler &&
$ackStamp =
$envelope->
last(AckStamp::
class)) { $ack =
new Acknowledger(get_debug_type($batchHandler),
static function D\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 =
$this->
callHandler($handler,
$message,
$ack,
$envelope->
last(HandlerArgumentsStamp::
class));
if (!\
is_int($result) || 0 >
$result) { throw new LogicException(sprintf('A handler implementing BatchHandlerInterface must return the size of the current batch as a positive integer, "%s" returned from "%s".', \
is_int($result) ?
$result :
get_debug_type($result),
get_debug_type($batchHandler)));
} if (!
$ack->
isAcknowledged()) { $envelope =
$envelope->
with(new NoAutoAckStamp($handlerDescriptor));
} elseif ($ack->
getError()) {