From bf29c5e01890cf8469e31d0097f029d0d54e973d Mon Sep 17 00:00:00 2001 From: "chris.boulton" Date: Sun, 27 Mar 2011 19:18:28 +1100 Subject: [PATCH] Add sample plugin --- extras/sample-plugin.php | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 extras/sample-plugin.php 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