MemoryBackend

Defines the memory flood backend. This is used for testing. Hierarchy class \Drupal\Core\Flood\MemoryBackend implements FloodInterface File core/lib/Drupal/Core/Flood/MemoryBackend.php, line 10 Namespace Drupal\Core\Flood Members Name Modifiers Type Description MemoryBackend::$events protected property An array holding flood events, keyed by event name and identifier. MemoryBackend::$requestStack protected property The request stack. MemoryBackend::clear publ

MemoryBackend

Defines a memory cache implementation. Stores cache items in memory using a PHP array. Should be used for unit tests and specialist use-cases only, does not store cached items between requests. Hierarchy class \Drupal\Core\Cache\MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterface Related topics Cache API Information about the Drupal Cache API File core/lib/Drupal/Core/Cache/MemoryBackend.php, line 15 Namespace Drupal\Core\Cache Members Name Modifiers Ty

Memory::__construct

public Memory::__construct($name) Constructs a Memory object. Parameters string $name: An arbitrary string. The name of the queue to work with. File core/lib/Drupal/Core/Queue/Memory.php, line 35 Class Memory Static queue implementation. Namespace Drupal\Core\Queue Code public function __construct($name) { $this->queue = array(); $this->idSequence = 0; }

Memory::releaseItem

public Memory::releaseItem($item) Releases an item that the worker could not process. Another worker can come in and process it before the timeout expires. Parameters $item: The item returned by \Drupal\Core\Queue\QueueInterface::claimItem(). Return value bool TRUE if the item has been released, FALSE otherwise. Overrides QueueInterface::releaseItem File core/lib/Drupal/Core/Queue/Memory.php, line 84 Class Memory Static queue implementation. Namespace Drupal\Core\Queue Code public fu

Memory::numberOfItems

public Memory::numberOfItems() Retrieves the number of items in the queue. This is intended to provide a "best guess" count of the number of items in the queue. Depending on the implementation and the setup, the accuracy of the results of this function may vary. e.g. On a busy system with a large number of consumers and items, the result might only be valid for a fraction of a second and not provide an accurate representation. Return value An integer estimate of the number of items in the queu

Memory::deleteQueue

public Memory::deleteQueue() Deletes a queue and every item in the queue. Overrides QueueInterface::deleteQueue File core/lib/Drupal/Core/Queue/Memory.php, line 102 Class Memory Static queue implementation. Namespace Drupal\Core\Queue Code public function deleteQueue() { $this->queue = array(); $this->idSequence = 0; }

Memory::deleteItem

public Memory::deleteItem($item) Deletes a finished item from the queue. Parameters $item: The item returned by \Drupal\Core\Queue\QueueInterface::claimItem(). Overrides QueueInterface::deleteItem File core/lib/Drupal/Core/Queue/Memory.php, line 77 Class Memory Static queue implementation. Namespace Drupal\Core\Queue Code public function deleteItem($item) { unset($this->queue[$item->item_id]); }

Memory::createQueue

public Memory::createQueue() Creates a queue. Called during installation and should be used to perform any necessary initialization operations. This should not be confused with the constructor for these objects, which is called every time an object is instantiated to operate on a queue. This operation is only needed the first time a given queue is going to be initialized (for example, to make a new database table or directory to hold tasks for the queue -- it depends on the queue implementation

Memory::createItem

public Memory::createItem($data) 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. Return value 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. Overrides QueueInterface::createItem File core/lib/Drupal/Core/Queue/Memory.php, line 43 Class

Memory::claimItem

public Memory::claimItem($lease_time = 30) Claims an item in the queue for processing. Parameters $lease_time: How long the processing is expected to take in seconds, defaults to an hour. After this lease expires, the item will be reset and another consumer can claim the item. For idempotent tasks (which can be run multiple times without side effects), shorter lease times would result in lower latency in case a consumer fails. For tasks that should not be run more than once (non-idempotent), a