7.x system.queue.inc DrupalQueueInterface::createItem($data)

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

Parameters

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

Return value

TRUE 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.

2 methods override DrupalQueueInterface::createItem()
MemoryQueue::createItem in modules/system/system.queue.inc
Add a queue item and store it directly to the queue.
SystemQueue::createItem in modules/system/system.queue.inc
Add a queue item and store it directly to the queue.

File

modules/system/system.queue.inc, line 112
Queue functionality.

Class

DrupalQueueInterface

Code

public function createItem($data);

Comments

sagar.choudhary’s picture

//we are creating the queue object for queue 'name_of_queue'
$queue = DrupalQueue::get('name_of_queue');
//now we are adding data to queue
$queue->createItem($data[$i])