Created
December 4, 2012 17:54
-
-
Save JesseObrien/4206849 to your computer and use it in GitHub Desktop.
Example Resque worker for Laravel
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 | |
class ExampleWorker | |
{ | |
// Resque looks for the "perform" function to "run" the worker, without it the worker won't run | |
public function perform() | |
{ | |
// All of your code should go here | |
// Don't hesitate to split the work into smaller parts | |
$this->do_work(); | |
// You can access your args that you passed from the task via | |
$this->args['name']; // John Smith | |
} | |
public function do_work() | |
{ | |
// You can also call this function | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment