mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 05:32:20 +00:00
Global reformat
This commit is contained in:
parent
14c0e26559
commit
51fda513f4
11 changed files with 532 additions and 533 deletions
|
@ -8,42 +8,42 @@ Resque_Event::listen('beforePerform', array('My_Resque_Plugin', 'beforePerform')
|
|||
Resque_Event::listen('afterPerform', array('My_Resque_Plugin', 'afterPerform'));
|
||||
Resque_Event::listen('onFailure', array('My_Resque_Plugin', 'onFailure'));
|
||||
|
||||
class My_Resque_Plugin
|
||||
class Sample_Resque_Plugin
|
||||
{
|
||||
public static function afterEnqueue($class, $arguments)
|
||||
{
|
||||
echo "Job was queued for " . $class . ". Arguments:";
|
||||
print_r($arguments);
|
||||
}
|
||||
|
||||
public static function beforeFirstFork($worker)
|
||||
{
|
||||
echo "Worker started. Listening on queues: " . implode(', ', $worker->queues(false)) . "\n";
|
||||
}
|
||||
|
||||
public static function beforeFork($job)
|
||||
{
|
||||
echo "Just about to fork to run " . $job;
|
||||
}
|
||||
|
||||
public static function afterFork($job)
|
||||
{
|
||||
echo "Forked to run " . $job . ". This is the child process.\n";
|
||||
}
|
||||
|
||||
public static function beforePerform($job)
|
||||
{
|
||||
echo "Cancelling " . $job . "\n";
|
||||
// throw new Resque_Job_DontPerform;
|
||||
}
|
||||
|
||||
public static function afterPerform($job)
|
||||
{
|
||||
echo "Just performed " . $job . "\n";
|
||||
}
|
||||
|
||||
public static function onFailure($exception, $job)
|
||||
{
|
||||
echo $job . " threw an exception:\n" . $exception;
|
||||
}
|
||||
public static function afterEnqueue($class, $arguments)
|
||||
{
|
||||
echo "Job was queued for " . $class . ". Arguments:";
|
||||
print_r($arguments);
|
||||
}
|
||||
|
||||
public static function beforeFirstFork($worker)
|
||||
{
|
||||
echo "Worker started. Listening on queues: " . implode(', ', $worker->queues(false)) . "\n";
|
||||
}
|
||||
|
||||
public static function beforeFork($job)
|
||||
{
|
||||
echo "Just about to fork to run " . $job;
|
||||
}
|
||||
|
||||
public static function afterFork($job)
|
||||
{
|
||||
echo "Forked to run " . $job . ". This is the child process.\n";
|
||||
}
|
||||
|
||||
public static function beforePerform($job)
|
||||
{
|
||||
echo "Cancelling " . $job . "\n";
|
||||
// throw new Resque_Job_DontPerform;
|
||||
}
|
||||
|
||||
public static function afterPerform($job)
|
||||
{
|
||||
echo "Just performed " . $job . "\n";
|
||||
}
|
||||
|
||||
public static function onFailure($exception, $job)
|
||||
{
|
||||
echo $job . " threw an exception:\n" . $exception;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue