public function __construct(Dispatcher $event, $bind) { parent::__construct($event, $bind); $event->bind(static::EVENT_SIGNAL, $this); $event->bind(static::EVENT_SOCKET_ACCEPT, $this); $this->addSignalEvents([SIGTERM, SIGUSR1, SIGUSR2, SIGCHLD]); }
public function __construct($dispatcher, $bind) { parent::__construct($dispatcher, $bind); $this->event->bind(static::EVENT_SOCKET_READ, $this); $this->event->bind(static::EVENT_SOCKET_WRITE, $this); $this->event->bind(static::EVENT_TIMER, $this); $this->timer = new TimerDispatcher(); $this->timer->insert([$this, 'onSocketInitWaitTimeoutTimer']); $this->timer->insert([$this, 'onSocketReadWaitTimeoutTimer']); }