Last active
October 16, 2017 16:15
-
-
Save ojhaujjwal/8d2e81d8168f2aa470c000d8d1f08bb3 to your computer and use it in GitHub Desktop.
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 | |
use Bernard\Router\SimpleRouter; | |
use Bernard\Consumer; | |
use Bernard\Queue\RoundRobinQueue; | |
$queues = [ | |
'default', | |
'notifications', | |
'emails' | |
]; | |
$queues = array_map( | |
function ($queueName) { | |
return $queueFactory->create($queueName); | |
}, | |
$queues | |
); | |
// Create a Consumer as shown in above example. | |
$consumer = new Consumer($router, $eventDispatcher); | |
$consumer->consume(new RoundRobinQueue($queues)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment