Bånder

IsMonitored

Tags
mixin

Table of Contents

Properties

$progressCurrentChunk  : int
Internal variable used for tracking chunking progress.
$progressLastUpdated  : int|null
The unix timestamp explaining the last time a progress has been written to database.

Methods

keepMonitorOnSuccess()  : bool
Weather to keep successful monitor models. This can be used if you only want to keep failed monitors for jobs that are frequently executed but worth to monitor. You are free to use the Laravel built-in failed job procedures.
progressCooldown()  : int
The time in seconds to wait before a following queue progress update will be issued.
queueData()  : void
Set Monitor data.
queueProgress()  : void
Update progress.
queueProgressChunk()  : void
Automatically update the current progress in each chunk iteration.
deleteQueueMonitor()  : void
Delete Queue Monitor object.
getQueueMonitor()  : QueueMonitor|null
Return Queue Monitor Model.
isQueueProgressOnCooldown()  : bool
Check if the monitor should skip writing the progress to database avoiding rapid update queries.

Properties

$progressCurrentChunk

Internal variable used for tracking chunking progress.

private int $progressCurrentChunk = 0

$progressLastUpdated

The unix timestamp explaining the last time a progress has been written to database.

private int|null $progressLastUpdated

Methods

keepMonitorOnSuccess()

Weather to keep successful monitor models. This can be used if you only want to keep failed monitors for jobs that are frequently executed but worth to monitor. You are free to use the Laravel built-in failed job procedures.

public static keepMonitorOnSuccess() : bool
Return values
bool

progressCooldown()

The time in seconds to wait before a following queue progress update will be issued.

public progressCooldown() : int

This is used to avoid writing many progress updates to the database. 0 = no delay.

Return values
int

queueData()

Set Monitor data.

public queueData(array<string|int, mixed> $data[, bool $merge = false ]) : void
Parameters
$data : array<string|int, mixed>

Custom data

$merge : bool = false

Merge the data instead of overriding

queueProgress()

Update progress.

public queueProgress(int $progress) : void
Parameters
$progress : int

Progress as integer 0-100

queueProgressChunk()

Automatically update the current progress in each chunk iteration.

public queueProgressChunk(int $collectionCount, int $perChunk) : void
Parameters
$collectionCount : int

The total collection item amount

$perChunk : int

The size of each chunk

deleteQueueMonitor()

Delete Queue Monitor object.

protected deleteQueueMonitor() : void

isQueueProgressOnCooldown()

Check if the monitor should skip writing the progress to database avoiding rapid update queries.

private isQueueProgressOnCooldown(int $progress) : bool

The progress values 0, 25, 50, 75 and 100 will always be written.

Parameters
$progress : int
Return values
bool

        
On this page

Search results