예제 #1
0
 /**
  * Revoke client connection listeners
  */
 protected function revokeListeners()
 {
     foreach (['response', 'error'] as $listener) {
         $this->listeners[$listener] = $this->conn->listeners('api-' . $listener);
         $this->conn->removeAllListeners('api-' . $listener);
     }
 }
예제 #2
0
 /**
  * A slave sent a `status` command.
  *
  * @param array      $data
  * @param Connection $conn
  */
 protected function commandStatus(array $data, Connection $conn)
 {
     //remove nasty info about worker's bootstrap fail
     $conn->removeAllListeners('close');
     if ($this->output->isVeryVerbose()) {
         $conn->on('close', function () {
             $this->output->writeln('Status command requested');
         });
     }
     $conn->end(json_encode(['slaveCount' => $this->slaveCount, 'handledRequests' => $this->handledRequests]));
 }
예제 #3
0
 protected function initWebSocket(SocketConnection $conn, Request $request)
 {
     $conn->removeAllListeners('data');
     return new WebSocketProtocol($conn, $this->app, $request);
 }