Created
April 11, 2014 14:43
-
-
Save Misiur/10474572 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 | |
namespace Mailbroker\MailDetailsBundle\EventListener; | |
use Symfony\Component\HttpKernel\Log\LoggerInterface; | |
use Mmoreram\GearmanBundle\Event\GearmanClientCallbackStatusEvent; | |
use Mmoreram\GearmanBundle\Event\GearmanClientCallbackCreatedEvent; | |
use Mmoreram\GearmanBundle\Event\GearmanClientCallbackCompleteEvent; | |
use GearmanJob; | |
/** | |
* Event listener for converter worker | |
*/ | |
class ConverterEventListener | |
{ | |
protected $logger; | |
/** | |
* Constructor | |
* | |
* @param LoggerInterface $logger | |
*/ | |
public function __construct(LoggerInterface $logger) | |
{ | |
$this->logger = $logger; | |
} | |
/** | |
* Callback called when job returns status | |
* | |
* @param GearmanClientCallbackStatusEvent $e | |
*/ | |
public function onStatus(GearmanClientCallbackStatusEvent $e) | |
{ | |
$this->logger->err('STATUS: ' . var_export($e->getGearmanTask(), true)); | |
} | |
/** | |
* Callback called when job is complete | |
* | |
* @param GearmanClientCallbackCompleteEvent $e | |
*/ | |
public function onComplete(GearmanClientCallbackCompleteEvent $e) | |
{ | |
$this->logger->err('COMFLETE: ' . var_export($e->getGearmanTask(), true)); | |
} | |
/** | |
* Callback called when job is created | |
* | |
* @param GearmanClientCallbackCreatedEvent $e | |
*/ | |
public function onCreated(GearmanClientCallbackCreatedEvent $e) | |
{ | |
$this->logger->err('CREATED ' . var_export($e->getGearmanTask(), true)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment