if (!
$receiver instanceof QueueReceiverInterface
) { throw new RuntimeException(sprintf('Receiver for "%s" does not implement "%s".',
$transportName, QueueReceiverInterface::
class));
} } } while (!
$this->shouldStop
) { $envelopeHandled = false;
$envelopeHandledStart =
$this->clock->
now();
foreach ($this->receivers
as $transportName =>
$receiver) { if ($queueNames) { $envelopes =
$receiver->
getFromQueues($queueNames);
} else { $envelopes =
$receiver->
get();
} foreach ($envelopes as $envelope) { $envelopeHandled = true;
$this->
rateLimit($transportName);
$this->
handleMessage($envelope,
$transportName);
$this->eventDispatcher?->
dispatch(new WorkerRunningEvent($this, false
));