class JobWatcher extends Watcher

Properties

protected array<int, class-string> $ignoredJobClasses

The list of ignored jobs classes.

Methods

__construct(array $options = [])

Create a new watcher instance.

from  Watcher
void
register(Application $app)

Register the watcher.

setOptions(array $options)

Set the watcher options.

from  Watcher
recordJob(string $connection, string|null $queue, array $payload)

Record a job being created.

void
recordProcessedJob(JobProcessed $event)

Record a queued job was processed.

void
recordFailedJob(JobFailed $event)

Record a queue job has failed.

array|null
facadeContext()

Get the current facade context for the job entry.

array
defaultJobData(string $connection, string|null $queue, array $payload, array $data)

Get the default entry data for the given job.

array
data(array $payload)

Extract the job "data" from the job payload.

array
tags(array $payload)

Extract the tags from the job payload.

void
updateBatch(array $payload)

Update the batch.

mixed
getCommand(array $data)

Get the command from the given payload.

string|null
getBatchId(array $data)

Get the batch ID from the given payload.

Details

in Watcher at line 16
__construct(array $options = [])

Create a new watcher instance.

Parameters

array $options

the configured watcher options

at line 42
void register(Application $app)

Register the watcher.

Parameters

Application $app

Return Value

void

in Watcher at line 29
Watcher setOptions(array $options)

Set the watcher options.

Parameters

array $options

Return Value

Watcher

at line 57
IncomingEntry|null recordJob(string $connection, string|null $queue, array $payload)

Record a job being created.

Parameters

string $connection
string|null $queue
array $payload

Return Value

IncomingEntry|null

at line 91
void recordProcessedJob(JobProcessed $event)

Record a queued job was processed.

Parameters

JobProcessed $event

Return Value

void

at line 125
void recordFailedJob(JobFailed $event)

Record a queue job has failed.

Parameters

JobFailed $event

Return Value

void

at line 173
protected array|null facadeContext()

Get the current facade context for the job entry.

Returns both visible and hidden context since jobs receive both, and "hidden" only means hidden from log output, not from Telescope. Returns null when no context exists.

Return Value

array|null

at line 196
protected array defaultJobData(string $connection, string|null $queue, array $payload, array $data)

Get the default entry data for the given job.

Parameters

string $connection
string|null $queue
array $payload
array $data

Return Value

array

at line 211
protected array data(array $payload)

Extract the job "data" from the job payload.

Parameters

array $payload

Return Value

array

at line 225
protected array tags(array $payload)

Extract the tags from the job payload.

Parameters

array $payload

Return Value

array

at line 239
protected void updateBatch(array $payload)

Update the batch.

Parameters

array $payload

Return Value

void

at line 275
protected mixed getCommand(array $data)

Get the command from the given payload.

Parameters

array $data

Return Value

mixed

Exceptions

RuntimeException

at line 293
protected string|null getBatchId(array $data)

Get the batch ID from the given payload.

Parameters

array $data

Return Value

string|null

Exceptions

RuntimeException