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

Breadcrumb

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

function AbstractDriver::run

Overrides Driver::run

4 calls to AbstractDriver::run()
EvDriver::run in vendor/revolt/event-loop/src/EventLoop/Driver/EvDriver.php
Run the event loop.
EvDriver::run in vendor/revolt/event-loop/src/EventLoop/Driver/EvDriver.php
Run the event loop.
EventDriver::run in vendor/revolt/event-loop/src/EventLoop/Driver/EventDriver.php
Run the event loop.
EventDriver::run in vendor/revolt/event-loop/src/EventLoop/Driver/EventDriver.php
Run the event loop.
2 methods override AbstractDriver::run()
EvDriver::run in vendor/revolt/event-loop/src/EventLoop/Driver/EvDriver.php
Run the event loop.
EventDriver::run in vendor/revolt/event-loop/src/EventLoop/Driver/EventDriver.php
Run the event loop.

File

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

Class

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

Namespace

Revolt\EventLoop\Internal

Code

public function run() : void {
    if ($this->fiber
        ->isRunning()) {
        throw new \Error("The event loop is already running");
    }
    if (\Fiber::getCurrent()) {
        throw new \Error(\sprintf("Can't call %s() within a fiber (i.e., outside of {main})", __METHOD__));
    }
    if ($this->fiber
        ->isTerminated()) {
        $this->createLoopFiber();
    }
    
    /** @noinspection PhpUnhandledExceptionInspection */
    $lambda = $this->fiber
        ->isStarted() ? $this->fiber
        ->resume() : $this->fiber
        ->start();
    if ($lambda) {
        $lambda();
        throw new \Error('Interrupt from event loop must throw an exception: ' . ClosureHelper::getDescription($lambda));
    }
}

API Navigation

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