Interop\Async\Loop::reference PHP 메소드

reference() 공개 정적인 메소드

This will keep the event loop alive whilst the watcher is still being monitored. Watchers have this state by default.
public static reference ( string $watcherId ) : void
$watcherId string The watcher identifier.
리턴 void
    public static function reference($watcherId)
    {
        $driver = self::$driver ?: self::get();
        $driver->reference($watcherId);
    }

Usage Example

예제 #1
0
 public function referenceReader(bool $reference)
 {
     if ($reference) {
         if ($this->readerEnabled && !$this->readerReferenced) {
             Loop::reference($this->readWatcher);
         }
     } else {
         if ($this->readerEnabled && $this->readerReferenced) {
             Loop::unreference($this->readWatcher);
         }
     }
     $this->readerReferenced = $reference;
 }