-
Notifications
You must be signed in to change notification settings - Fork 0
broker
Joshua Estes edited this page Oct 4, 2017
·
3 revisions
The Broker allows you a central place to manage multiple queues. Once you initialize a Queue, you can add this to the Broker and use this to get any of the Queues.
<?php
use Dspacelabs\Component\Queue\Broker;
// Initialize the Broker object
$broker = new Broker();
// ... initial multiple different queues ...
// Add Queues to Broker
$broker->addQueue($queueName);
$broker->addQueue($other);
// Publish a message to the "queue.name" queue
$broker->get('queue.name')->publish($message);
// Publish a message to the "other" queue
$broker->get('other')->publish($anotherMessage);