Properties

$node

$node : 

The nodeq table name.

Type

$prefix

$prefix : \TriTan\Queue\type

Table prefix.

Type

\TriTan\Queue\type

$name

$name : string

The name of the queue this instance is working with.

Type

string

$lease_time

$lease_time : 

How long the processing is expected to take in seconds.

Type

$debug

$debug : 

Send NodeQ Queue internal messages to 'ttcms-error*.txt'

Type

$schedule

$schedule : 

When should the process run.

Type

$db

$db : 

Type

$hook

$hook : 

Type

Methods

__construct()

__construct(array  $config = array()) 

Constructs a \Liten\Liten $liten object.

Parameters

array $config

The name of the queue.

node()

node() 

isDue()

isDue(string|callable  $schedule) : boolean

Parameters

string|callable $schedule

Returns

boolean

createItem()

createItem(  $data) 

{@inheritdoc}

Parameters

$data

numberOfItems()

numberOfItems() 

{@inheritdoc}

claimItem()

claimItem(  $lease_time = 30) 

{@inheritdoc}

Parameters

$lease_time

releaseItem()

releaseItem(  $item) 

{@inheritdoc}

Parameters

$item

deleteItem()

deleteItem(  $item) 

{@inheritdoc}

Parameters

$item

createQueue()

createQueue() 

{@inheritdoc}

deleteQueue()

deleteQueue() 

{@inheritdoc}

garbageCollection()

garbageCollection() 

Cleans queues of garbage.

executeAction()

executeAction(  $data) 

Parameters

$data

doCreateItem()

doCreateItem(  $data) : \TriTan\Queue\A

Adds a queue item and store it directly to the queue.

Parameters

$data

Arbitrary data to be associated with the new task in the queue.

Returns

\TriTan\Queue\A —

unique ID if the item was successfully created and was (best effort) added to the queue, otherwise false. We don't guarantee the item was committed to disk etc, but as far as we know, the item is now in the queue.

catchException()

catchException(  $e) 

Act on an exception when queue might be stale.

If the node does not yet exist, that's fine, but if the node exists and yet the query failed, then the queue is stale and the exception needs to propagate.

Parameters

$e

The exception.

Throws

\TriTan\Exception\Exception

If the node exists the exception passed in is rethrown.