@@ -150,22 +150,26 @@ To track the status of a job, pass `true` as the fourth argument to
150
150
` Resque::enqueue ` . A token used for tracking the job status will be
151
151
returned:
152
152
153
+ ``` php
153
154
$token = Resque::enqueue('default', 'My_Job', $args, true);
154
155
echo $token;
156
+ ```
155
157
156
158
To fetch the status of a job:
157
159
160
+ ``` php
158
161
$status = new Resque_Job_Status($token);
159
162
echo $status->get(); // Outputs the status
163
+ ```
160
164
161
165
Job statuses are defined as constants in the ` Resque_Job_Status ` class.
162
166
Valid statuses include:
163
167
164
- * `Resque_Job_Status::STATUS_WAITING` - Job is still queued
165
- * `Resque_Job_Status::STATUS_RUNNING` - Job is currently running
166
- * `Resque_Job_Status::STATUS_FAILED` - Job has failed
167
- * `Resque_Job_Status::STATUS_COMPLETE` - Job is complete
168
- * `false` - Failed to fetch the status - is the token valid?
168
+ * ` Resque_Job_Status::STATUS_WAITING ` - Job is still queued
169
+ * ` Resque_Job_Status::STATUS_RUNNING ` - Job is currently running
170
+ * ` Resque_Job_Status::STATUS_FAILED ` - Job has failed
171
+ * ` Resque_Job_Status::STATUS_COMPLETE ` - Job is complete
172
+ * ` false ` - Failed to fetch the status - is the token valid?
169
173
170
174
Statuses are available for up to 24 hours after a job has completed
171
175
or failed, and are then automatically expired. A status can also
@@ -274,11 +278,11 @@ the job.
274
278
Signals also work on supported platforms exactly as in the Ruby
275
279
version of Resque:
276
280
277
- * `QUIT` - Wait for child to finish processing then exit
278
- * `TERM` / `INT` - Immediately kill child then exit
279
- * `USR1` - Immediately kill child but don't exit
280
- * `USR2` - Pause worker, no new jobs will be processed
281
- * `CONT` - Resume worker.
281
+ * ` QUIT ` - Wait for child to finish processing then exit
282
+ * ` TERM ` / ` INT ` - Immediately kill child then exit
283
+ * ` USR1 ` - Immediately kill child but don't exit
284
+ * ` USR2 ` - Pause worker, no new jobs will be processed
285
+ * ` CONT ` - Resume worker.
282
286
283
287
### Process Titles/Statuses ###
284
288
@@ -309,10 +313,10 @@ raised:
309
313
310
314
` [callback] ` may be anything in PHP that is callable by ` call_user_func_array ` :
311
315
312
- * A string with the name of a function
313
- * An array containing an object and method to call
314
- * An array containing an object and a static method to call
315
- * A closure (PHP 5.3)
316
+ * A string with the name of a function
317
+ * An array containing an object and method to call
318
+ * An array containing an object and a static method to call
319
+ * A closure (PHP 5.3)
316
320
317
321
Events may pass arguments (documented below), so your callback should accept
318
322
these arguments.
@@ -389,24 +393,24 @@ Called after a job has been queued using the `Resque::enqueue` method. Arguments
389
393
390
394
## Contributors ##
391
395
392
- * chrisboulton
393
- * thedotedge
394
- * hobodave
395
- * scraton
396
- * KevBurnsJr
397
- * jmathai
398
- * dceballos
399
- * patrickbajao
400
- * andrewjshults
401
- * warezthebeef
402
- * d11wtq
403
- * hlegius
404
- * salimane
405
- * humancopy
406
- * pedroarnal
407
- * chaitanyakuber
408
- * maetl
409
- * Matt Heath
410
- * jjfrey
411
- * scragg0x
412
- * ruudk
396
+ * chrisboulton
397
+ * thedotedge
398
+ * hobodave
399
+ * scraton
400
+ * KevBurnsJr
401
+ * jmathai
402
+ * dceballos
403
+ * patrickbajao
404
+ * andrewjshults
405
+ * warezthebeef
406
+ * d11wtq
407
+ * hlegius
408
+ * salimane
409
+ * humancopy
410
+ * pedroarnal
411
+ * chaitanyakuber
412
+ * maetl
413
+ * Matt Heath
414
+ * jjfrey
415
+ * scragg0x
416
+ * ruudk
0 commit comments