mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-24 17:25:13 +00:00
Fix up enqueue example arguments - they're now an object. Add example of how to access arguments in the example job
This commit is contained in:
parent
cb4205d508
commit
e3c953baf1
@ -45,9 +45,8 @@ Jobs are queued as follows:
|
|||||||
// Required if redis is located elsewhere
|
// Required if redis is located elsewhere
|
||||||
Resque::setBackend('localhost', 6379);
|
Resque::setBackend('localhost', 6379);
|
||||||
|
|
||||||
$args = array(
|
$args = new stdClass;
|
||||||
'name' => 'Chris'
|
$args->name = 'Chris';
|
||||||
);
|
|
||||||
Resque::enqueue('default', 'My_Job', $args);
|
Resque::enqueue('default', 'My_Job', $args);
|
||||||
|
|
||||||
### Defining Jobs ###
|
### Defining Jobs ###
|
||||||
@ -60,6 +59,7 @@ It's important to note that classes are called statically.
|
|||||||
public static function perform($args)
|
public static function perform($args)
|
||||||
{
|
{
|
||||||
// Work work work
|
// Work work work
|
||||||
|
echo $args->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user