Kohkimakimoto\Worker\EventLoop\Factory::create PHP Метод

create() публичный статический Метод

public static create ( )
    public static function create()
    {
        $eventLoop = parent::create();
        if ($eventLoop instanceof \React\EventLoop\StreamSelectLoop) {
            return new StreamSelectLoop();
        }
    }

Usage Example

Пример #1
0
 /**
  * Constructor.
  *
  * @param array $config configuration parameters.
  */
 public function __construct($config = array())
 {
     $this->masterPid = posix_getpid();
     $this->finished = false;
     // Registers fundamental instances.
     $this['config'] = new Config($config);
     $this["eventLoop"] = Factory::create();
     $this["output"] = new ConsoleOutput();
     $this['dispatcher'] = new EventDispatcher();
     if ($this->config->isDebug()) {
         $this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
     }
     // Registers default providers.
     $this->registerDefaultProviders();
 }
Factory