Icicle\Loop\AbstractLoop::__construct PHP Method

__construct() public method

public __construct ( boolean $enableSignals = true )
$enableSignals boolean True to enable signal handling, false to disable.
    public function __construct($enableSignals = true)
    {
        $this->callableQueue = new CallableQueue(self::DEFAULT_MAX_DEPTH);
        $this->immediateManager = $this->createImmediateManager();
        $this->timerManager = $this->createTimerManager();
        $this->pollManager = $this->createPollManager();
        $this->awaitManager = $this->createAwaitManager();
        if ($enableSignals && extension_loaded('pcntl')) {
            $this->signalManager = $this->createSignalManager();
        }
    }

Usage Example

コード例 #1
0
ファイル: EventLoop.php プロジェクト: kanzuka/icicle
 /**
  * @param bool $enableSignals True to enable signal handling, false to disable.
  * @param \Icicle\Loop\Events\EventFactoryInterface|null $eventFactory
  * @param \EventBase|null $base Use null for an EventBase object to be automatically created.
  *
  * @throws \Icicle\Loop\Exception\UnsupportedError If the event extension is not loaded.
  */
 public function __construct(bool $enableSignals = true, EventFactoryInterface $eventFactory = null, EventBase $base = null)
 {
     // @codeCoverageIgnoreStart
     if (!self::enabled()) {
         throw new UnsupportedError(__CLASS__ . ' requires the event extension.');
     }
     // @codeCoverageIgnoreEnd
     $this->base = $base ?: new EventBase();
     parent::__construct($enableSignals, $eventFactory);
 }
All Usage Examples Of Icicle\Loop\AbstractLoop::__construct