/**
* @param ReceiverInterface[] $receivers Where the key is the transport name
*/
public function __construct( private array
$receivers,
private MessageBusInterface
$bus,
private ?EventDispatcherInterface
$eventDispatcher = null,
private ?LoggerInterface
$logger = null,
private ?array
$rateLimiters = null,
private ClockInterface
$clock =
new Clock(),
) { $this->metadata =
new WorkerMetadata([ 'transportNames' =>
array_keys($receivers),
]);
$this->unacks =
new \
SplObjectStorage();
} /**
* Receive the messages and dispatch them to the bus.
*
* Valid options are:
* * sleep (default: 1000000): Time in microseconds to sleep after no messages are found
* * queues: The queue names to consume from, instead of consuming from all queues. When this is used, all receivers must implement the QueueReceiverInterface
*/