class CRM_Queue_Service

The queue service provides an interface for creating or locating queues. Note that this approach hides the details of data-storage: different queue-providers may store the queue content in different ways (in memory, in SQL, or in an external service).

Properties

static protected $_singleton
array $queues

Methods

singleton(bool $forceNew = FALSE)

FIXME: Singleton pattern should be removed when dependency-injection becomes available.

__construct()

No description

create(array $queueSpec)

Create a queue. If one already exists, then it will be reused.

load(array $queueSpec)

Look up an existing queue.

string
getQueueClass(string $type)

Convert a queue "type" name to a class name.

instantiateQueueObject(array $queueSpec)

No description

Details

at line 65
static CRM_Queue_Service singleton(bool $forceNew = FALSE)

FIXME: Singleton pattern should be removed when dependency-injection becomes available.

Parameters

bool $forceNew TRUE if a new instance must be created.

Return Value

CRM_Queue_Service

at line 79
__construct()

at line 97
CRM_Queue_Queue create(array $queueSpec)

Create a queue. If one already exists, then it will be reused.

Parameters

array $queueSpec Array with keys: - type: string, required, e.g. "interactive", "immediate", "stomp", "beanstalk" - name: string, required, e.g. "upgrade-tasks" - reset: bool, optional; if a queue is found, then it should be flushed; default to TRUE - (additional keys depending on the queue provider).

Return Value

CRM_Queue_Queue

at line 130
CRM_Queue_Queue load(array $queueSpec)

Look up an existing queue.

Parameters

array $queueSpec Array with keys: - type: string, required, e.g. "interactive", "immediate", "stomp", "beanstalk" - name: string, required, e.g. "upgrade-tasks" - (additional keys depending on the queue provider).

Return Value

CRM_Queue_Queue

at line 149
protected string getQueueClass(string $type)

Convert a queue "type" name to a class name.

Parameters

string $type E.g. "interactive", "immediate", "stomp", "beanstalk".

Return Value

string Class-name

at line 166
protected CRM_Queue_Queue instantiateQueueObject(array $queueSpec)

Parameters

array $queueSpec See create().

Return Value

CRM_Queue_Queue