mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 05:32:20 +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
1 changed files with 3 additions and 3 deletions
|
@ -45,9 +45,8 @@ Jobs are queued as follows:
|
|||
// Required if redis is located elsewhere
|
||||
Resque::setBackend('localhost', 6379);
|
||||
|
||||
$args = array(
|
||||
'name' => 'Chris'
|
||||
);
|
||||
$args = new stdClass;
|
||||
$args->name = 'Chris';
|
||||
Resque::enqueue('default', 'My_Job', $args);
|
||||
|
||||
### Defining Jobs ###
|
||||
|
@ -60,6 +59,7 @@ It's important to note that classes are called statically.
|
|||
public static function perform($args)
|
||||
{
|
||||
// Work work work
|
||||
echo $args->name;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue