Interop\Async\Loop::cancel PHP Method

cancel() public static method

This will detatch the event loop from all resources that are associated to the watcher. After this operation the watcher is permanently invalid. Calling this function MUST NOT fail, even if passed an invalid watcher.
public static cancel ( string $watcherId ) : void
$watcherId string The watcher identifier.
return void
    public static function cancel($watcherId)
    {
        $driver = self::$driver ?: self::get();
        $driver->cancel($watcherId);
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function cancel(\Throwable $e) : array
 {
     if ($this->state === self::PENDING) {
         Loop::cancel($this->watcher);
         $this->fail($e);
     }
     return [];
 }
All Usage Examples Of Interop\Async\Loop::cancel