Skip to content

Instantly share code, notes, and snippets.

@JesseObrien
Created December 4, 2012 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JesseObrien/4206849 to your computer and use it in GitHub Desktop.
Save JesseObrien/4206849 to your computer and use it in GitHub Desktop.
Example Resque worker for Laravel
<?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