\DevOwl\RealQueue\queueQuery

Query jobs and transform them to a proper `Job` instance.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
setupConstants()
__construct()
read()
fetchById()
readRemaining()
readCurrentJobs()
No public properties found
No constants found
lockUntil()
castRows()
No protected properties found
N/A
No private methods found
$core
N/A

Properties

$core

$core :

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.

read()

read(array  $args = array()): array<mixed,\DevOwl\RealQueue\queue\Job>

Read jobs and cast them to proper `Job` instance.

Arguments:

  • [limit]
  • [type=all|pending|failure]
  • [jobType]
  • [dataContains] Allows you in a very basic way to check if a job exists by data LIKE '%YOUR_STRING%'
  • [ids] An array of Job ids which should be read
  • [omitClientData=false] If true, data will be omitted for server workers
  • [after] Read all job ids after that one
  • [lockUntil=0] Add this seconds to UNIX-timestamp and mark the read jobs as locked_until

Parameters

array $args

Returns

array<mixed,\DevOwl\RealQueue\queue\Job>

fetchById()

fetchById(integer  $id): \DevOwl\RealQueue\queue\Job|null

Fetch a single job by ID.

Parameters

integer $id

Returns

\DevOwl\RealQueue\queue\Job|null

readRemaining()

readRemaining()

Read remaining jobs per type. This does not count failed jobs! The result is an associative array:

[type: string]: [remaining: number, total: number, failure: number]

readCurrentJobs()

readCurrentJobs(boolean  $omitClientData = false)

Read current jobs per type.

Parameters

boolean $omitClientData

lockUntil()

lockUntil(array<mixed,integer>  $ids,integer  $seconds)

Lock a set of jobs by a given time of seconds.

Parameters

array<mixed,integer> $ids
integer $seconds

castRows()

castRows(array  $rows)

Cast read jobs to `Job` instance.

Parameters

array $rows