php-kue
php-kue copied to clipboard
request update README.md: how to report succes/failure of job when processing
It seems this project is more complete than the README.md suggests :)
Please add this snippet to README.md:
Job failure / progress
// Process the `email` type job
$kue->on('process:email', function($job){
$data = $job->data
$job->progress(50); // communicate progress to queue 1..100
if( ! mail($data['to'], $data['subject'], $data['body']) ){
// uncaught exception will mark a job as failed and/or increase its attempt-variable
throw new Exception("FOO_BAR");
}
});
optionally you can call the following to modify the job status directly:
$job->failed()$job->complete()$job->inactive()$job->active()
OK, thanks a lot, And you can give me a PR to become the contributor of php-kue.
done: https://github.com/hfcorriez/php-kue/pull/3
Need to merge!