diff --git a/extras/sample-plugin.php b/extras/sample-plugin.php new file mode 100644 index 0000000..e70dffd --- /dev/null +++ b/extras/sample-plugin.php @@ -0,0 +1,49 @@ +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; + } +} \ No newline at end of file