Skip to content

Instantly share code, notes, and snippets.

@ojhaujjwal
Last active October 16, 2017 15:32
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/dfc87a773b86542b755e444a0c7cc5ce to your computer and use it in GitHub Desktop.
Save ojhaujjwal/dfc87a773b86542b755e444a0c7cc5ce to your computer and use it in GitHub Desktop.
<?php
use Bernard\Router\SimpleRouter;
use Bernard\Consumer;
use Symfony\Component\EventDispatcher\EventDispatcher;
// .. create driver and a queuefactory
$router = new SimpleRouter();
$router->add('SendForgotPasswordEmail', function() {
//TODO: here's the logic to sending your email
});
$eventDispatcher = new EventDispatcher();
// Create a Consumer and start the loop.
$consumer = new Consumer($router, $eventDispatcher);
$consumer->consume($queueFactory->create('emails'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment