You are here

function queue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/src/functions.php \GuzzleHttp\Promise\queue()

Get the global task queue used for promise resolution.

This task queue MUST be run in an event loop in order for promises to be settled asynchronously. It will be automatically run when synchronously waiting on a promise.

<code> while ($eventLoop->isRunning()) { GuzzleHttp\Promise\queue()->run(); } </code>

Return value

TaskQueue

3 calls to queue()
FulfilledPromise::then in vendor/guzzlehttp/promises/src/FulfilledPromise.php
Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
RejectedPromise::then in vendor/guzzlehttp/promises/src/RejectedPromise.php
Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
task in vendor/guzzlehttp/promises/src/functions.php
Adds a function to run in the task queue when it is next `run()` and returns a promise that is fulfilled or rejected with the result.
6 string references to 'queue'
drupal7.php in core/modules/migrate_drupal/tests/fixtures/drupal7.php
A database agnostic dump for testing purposes.
DrupalTest::testQueue in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the queue() method.
GarbageCollectionTest::setUp in core/modules/system/src/Tests/KeyValueStore/GarbageCollectionTest.php
Performs setup tasks before each individual test method is run.
LocaleConfigSubscriberTest::setUp in core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php
Performs setup tasks before each individual test method is run.
QueueSerializationTest::setUp in core/modules/system/src/Tests/Queue/QueueSerializationTest.php
Performs setup tasks before each individual test method is run.

... See full list

File

vendor/guzzlehttp/promises/src/functions.php, line 19

Namespace

GuzzleHttp\Promise

Code

function queue() {
  static $queue;
  if (!$queue) {
    $queue = new TaskQueue();
  }
  return $queue;
}