\DevOwl\RealQueue\queuePersist

Persist new elements to the queue.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
setupConstants()
__construct()
startGroup()
stopGroup()
startTransaction()
addJob()
commit()
clearJobTable()
deleteByType()
retryByType()
skipByType()
No public properties found
TABLE_NAME
fillGroupTotal()
No protected properties found
N/A
No private methods found
$core
$jobs
$group_uuid
N/A

Constants

TABLE_NAME

TABLE_NAME ='p_queue'

Properties

$core

$core :

Type

$group_uuid

$group_uuid :

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this package so we can utils package natively.

Returns

string

setupConstants()

setupConstants()

Make sure the REAL_QUEUE constants are available.

__construct()

__construct(\DevOwl\RealQueue\queue\Core  $core)

C'tor.

Parameters

\DevOwl\RealQueue\queue\Core $core

startGroup()

startGroup(): string

Start a group for the next added items. This can help you to keep track of "bundled" jobs. Please consider to `stopGroup`, too!

Returns

string —

The used UUID for this group, you do not have to manually set the group_id in your upcoming models!

stopGroup()

stopGroup()

Stop the group.

startTransaction()

startTransaction()

Start the persist mechanism.

addJob()

addJob(\DevOwl\RealQueue\queue\Job  $job)

Add a new job. You can pass multiple jobs, but do not forget to `commit` your jobs so they get persisted to the database!

Parameters

\DevOwl\RealQueue\queue\Job $job

commit()

commit()

Write the jobs to the database.

clearJobTable()

clearJobTable()

Clear the queue / job database table. Cause we do not want to get a messy database.

If you want to keep statistics, do this in your job callback and persist data to your own database table.

deleteByType()

deleteByType(string  $type)

Delete jobs by type. This is similar to "Cancel".

Parameters

string $type

retryByType()

retryByType(string  $type)

Retry jobs by type.

Parameters

string $type

skipByType()

skipByType(string  $type)

Skip jobs by type.

Parameters

string $type

fillGroupTotal()

fillGroupTotal()

Fill `group_total`. Why is this not calculated in our database? Our database is self-cleaning because all done jobs are automatically erased after some time (e.g. each 100 records).