Laravoole\Wrapper\Swoole::start PHP 메소드

start() 공개 메소드

public start ( )
    public function start()
    {
        $callbacks = array_merge(['Start' => [$this, 'onServerStart'], 'Shutdown' => [$this, 'onServerShutdown'], 'WorkerStart' => [$this, 'onWorkerStart'], 'Request' => [$this, 'onRequest']], $this->callbacks);
        if (isset($this->wrapper_config['swoole_ontask'])) {
            $callbacks['Task'] = $this->wrapper_config['swoole_ontask'];
            $callbacks['Finish'] = $this->wrapper_config['swoole_onfinish'];
        }
        foreach ($callbacks as $on => $method) {
            $this->server->on($on, $method);
        }
        $this->server->start();
    }

Usage Example

예제 #1
0
 public function start()
 {
     if (!empty($this->handler_config)) {
         $this->server->set($this->handler_config);
     }
     parent::start();
 }