Elgg  Version master
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Elgg\Queue\DatabaseQueue Class Reference

FIFO queue that uses the database for persistence. More...

Inheritance diagram for Elgg\Queue\DatabaseQueue:
Elgg\Queue\Queue Elgg\Notifications\NotificationsQueue

Public Member Functions

 __construct (protected string $name, protected\Elgg\Database $db)
 Create a queue. More...
 
 enqueue ($item)
 {Add an item to the queue.
Parameters
mixed$itemItem to add to queue
Returns
bool
} More...
 
 dequeue ()
 {Remove an item from the queue.
Returns
mixed
} More...
 
 clear ()
 {Clear all items from the queue.
Returns
void
} More...
 
 size ()
 {Get the size of the queue.
Returns
int
} More...
 

Public Attributes

const TABLE_NAME = 'queue'
 

Protected Attributes

 $workerId
 

Detailed Description

FIFO queue that uses the database for persistence.

Definition at line 17 of file DatabaseQueue.php.

Constructor & Destructor Documentation

Elgg\Queue\DatabaseQueue::__construct ( protected string  $name,
protected\Elgg\Database  $db 
)

Create a queue.

Parameters
string$nameName of the queue. Must be less than 256 characters.
\Elgg\Database$dbDatabase adapter

Definition at line 37 of file DatabaseQueue.php.

Member Function Documentation

Elgg\Queue\DatabaseQueue::clear ( )

{Clear all items from the queue.

Returns
void
}

Implements Elgg\Queue\Queue.

Definition at line 95 of file DatabaseQueue.php.

Elgg\Queue\DatabaseQueue::dequeue ( )

{Remove an item from the queue.

Returns
mixed
}

Implements Elgg\Queue\Queue.

Definition at line 58 of file DatabaseQueue.php.

Elgg\Queue\DatabaseQueue::enqueue (   $item)

{Add an item to the queue.

Parameters
mixed$itemItem to add to queue
Returns
bool
}

Implements Elgg\Queue\Queue.

Definition at line 44 of file DatabaseQueue.php.

Elgg\Queue\DatabaseQueue::size ( )

{Get the size of the queue.

Returns
int
}

Implements Elgg\Queue\Queue.

Definition at line 105 of file DatabaseQueue.php.

Member Data Documentation

Elgg\Queue\DatabaseQueue::$workerId
protected

Definition at line 29 of file DatabaseQueue.php.

const Elgg\Queue\DatabaseQueue::TABLE_NAME = 'queue'

Definition at line 24 of file DatabaseQueue.php.


The documentation for this class was generated from the following file: