\think\queueWorker

Summary

Methods
Properties
Constants
pop()
process()
sleep()
No public properties found
No constants found
getNextJob()
logFailedJob()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

pop()

pop(string  $queue = null, int  $delay, int  $sleep = 3, int  $maxTries) : array

执行下个任务

Parameters

string $queue
int $delay
int $sleep
int $maxTries

Returns

array —

process()

process(\think\queue\Job  $job, int  $maxTries, int  $delay) : array

Process a given job from the queue.

Parameters

\think\queue\Job $job
int $maxTries
int $delay

Throws

\Exception

Returns

array —

sleep()

sleep(int  $seconds) : void

Sleep the script for a given number of seconds.

Parameters

int $seconds

getNextJob()

getNextJob(string  $queue) : \think\queue\Job

获取下个任务

Parameters

string $queue

Returns

\think\queue\Job —

logFailedJob()

logFailedJob(\Think\Queue\Job  $job) : array

Log a failed job into storage.

Parameters

\Think\Queue\Job $job

Returns

array —