Properties

$instance

$instance : mixed

The job handler instance.

Type

mixed

$queue

$queue : string

The name of the queue the job belongs to.

Type

string

$deleted

$deleted : bool

Indicates if the job has been deleted.

Type

bool

$released

$released : bool

Indicates if the job has been released.

Type

bool

$redis

$redis : \think\queue\connector\Redis

The redis queue instance.

Type

Redis

$job

$job : object

The database job payload.

Type

object

Methods

fire()

fire() : void

Fire the job.

delete()

delete() : void

删除任务

isDeleted()

isDeleted() : bool

Determine if the job has been deleted.

Returns

bool —

release()

release(int  $delay) : void

重新发布任务

Parameters

int $delay

isReleased()

isReleased() : bool

Determine if the job was released back into the queue.

Returns

bool —

isDeletedOrReleased()

isDeletedOrReleased() : bool

Determine if the job has been deleted or released.

Returns

bool —

attempts()

attempts() : int

Get the number of times the job has been attempted.

Returns

int —

getRawBody()

getRawBody() : string

Get the raw body string for the job.

Returns

string —

failed()

failed() : void

Call the failed method on the job instance.

getName()

getName() : string

Get the name of the queued job class.

Returns

string —

getQueue()

getQueue() : string

Get the name of the queue the job belongs to.

Returns

string —

__construct()

__construct(\think\queue\connector\Redis  $redis, mixed  $job, mixed  $queue) : mixed

Parameters

\think\queue\connector\Redis $redis
mixed $job
mixed $queue

Returns

mixed —

resolveAndFire()

resolveAndFire(array  $payload) : void

Resolve and fire the job handler method.

Parameters

array $payload

parseJob()

parseJob(string  $job) : array

Parse the job declaration into class and method.

Parameters

string $job

Returns

array —

resolve()

resolve(string  $name) : mixed

Resolve the given job handler.

Parameters

string $name

Returns

mixed —

getSeconds()

getSeconds(\DateTime|int  $delay) : int

Calculate the number of seconds with the given delay.

Parameters

\DateTime|int $delay

Returns

int —

getTime()

getTime() : int

Get the current system time.

Returns

int —