mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 13:42:22 +00:00
Change arguments for jobs to an array instead of an object. Also change other json encoded items to decode to an array rather than objects
This commit is contained in:
parent
7ef1ebbd97
commit
c5396f4e86
10 changed files with 81 additions and 78 deletions
|
@ -45,8 +45,9 @@ Jobs are queued as follows:
|
|||
// Required if redis is located elsewhere
|
||||
Resque::setBackend('localhost', 6379);
|
||||
|
||||
$args = new stdClass;
|
||||
$args->name = 'Chris';
|
||||
$args = array(
|
||||
'name' => 'Chris'
|
||||
);
|
||||
Resque::enqueue('default', 'My_Job', $args);
|
||||
|
||||
### Defining Jobs ###
|
||||
|
@ -59,7 +60,7 @@ It's important to note that classes are called statically.
|
|||
public static function perform($args)
|
||||
{
|
||||
// Work work work
|
||||
echo $args->name;
|
||||
echo $args['name'];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +78,7 @@ To track the status of a job, pass `true` as the fourth argument to
|
|||
`Resque::enqueue`. A token used for tracking the job status will be
|
||||
returned:
|
||||
|
||||
$token = Resque::enqueue('default', 'My_Job', $args);
|
||||
$token = Resque::enqueue('default', 'My_Job', $args, true);
|
||||
echo $token;
|
||||
|
||||
To fetch the status of a job:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue