Esempio n. 1
0
 /**
  * 停止当前worker实例
  * @return void
  */
 public function stop()
 {
     // 如果有设置进程终止回调,则执行
     if ($this->onWorkerStop) {
         try {
             call_user_func($this->onWorkerStop, $this);
         } catch (\Exception $e) {
             echo $e;
             exit(250);
         }
     }
     // 删除相关监听事件,关闭_mainSocket
     self::$globalEvent->del($this->_mainSocket, EventInterface::EV_READ);
     @fclose($this->_mainSocket);
 }
Esempio n. 2
0
 /**
  * Stop current worker instance.
  * @return void
  */
 public function stop()
 {
     // Try to emit onWorkerStop callback.
     if ($this->onWorkerStop) {
         try {
             call_user_func($this->onWorkerStop, $this);
         } catch (\Exception $e) {
             echo $e;
             exit(250);
         }
     }
     // Remove listener for server socket.
     self::$globalEvent->del($this->_mainSocket, EventInterface::EV_READ);
     @fclose($this->_mainSocket);
 }
Esempio n. 3
0
 /**
  * 停止当前worker实例
  * @return void
  */
 public function stop()
 {
     // 如果有设置进程终止回调,则执行
     if ($this->onWorkerStop) {
         call_user_func($this->onWorkerStop, $this);
     }
     // 删除相关监听事件,关闭_mainSocket
     self::$globalEvent->del($this->_mainSocket, EventInterface::EV_READ);
     @fclose($this->_mainSocket);
 }