Skip to content

Instantly share code, notes, and snippets.

@ojhaujjwal
Last active October 16, 2017 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojhaujjwal/8d2e81d8168f2aa470c000d8d1f08bb3 to your computer and use it in GitHub Desktop.
Save ojhaujjwal/8d2e81d8168f2aa470c000d8d1f08bb3 to your computer and use it in GitHub Desktop.
<?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