Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractDriver.php

function AbstractDriver::__construct

8 calls to AbstractDriver::__construct()
EvDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/EvDriver.php
EvDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/EvDriver.php
EventDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/EventDriver.php
EventDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/EventDriver.php
StreamSelectDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/StreamSelectDriver.php

... See full list

4 methods override AbstractDriver::__construct()
EvDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/EvDriver.php
EventDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/EventDriver.php
StreamSelectDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/StreamSelectDriver.php
UvDriver::__construct in vendor/revolt/event-loop/src/EventLoop/Driver/UvDriver.php

File

vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php, line 67

Class

AbstractDriver
Event loop driver which implements all basic operations to allow interoperability.

Namespace

Revolt\EventLoop\Internal

Code

public function __construct() {
    if (\PHP_VERSION_ID < 80117 || \PHP_VERSION_ID >= 80200 && \PHP_VERSION_ID < 80204) {
        // PHP GC is broken on early 8.1 and 8.2 versions, see https://github.com/php/php-src/issues/10496
        if (!\getenv('REVOLT_DRIVER_SUPPRESS_ISSUE_10496')) {
            throw new \Error('Your version of PHP is affected by serious garbage collector bugs related to fibers. Please upgrade to a newer version of PHP, i.e. >= 8.1.17 or => 8.2.4');
        }
    }
    $this->suspensions = new \WeakMap();
    $this->internalSuspensionMarker = new \stdClass();
    $this->microtaskQueue = new \SplQueue();
    $this->callbackQueue = new \SplQueue();
    $this->createLoopFiber();
    $this->createCallbackFiber();
    $this->createErrorCallback();
    
    /** @psalm-suppress InvalidArgument */
    $this->interruptCallback = $this->setInterrupt(...);
    $this->queueCallback = $this->queue(...);
    $this->runCallback = function () {
        if ($this->fiber
            ->isTerminated()) {
            $this->createLoopFiber();
        }
        return $this->fiber
            ->isStarted() ? $this->fiber
            ->resume() : $this->fiber
            ->start();
    };
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal