コード例 #1
0
 /**
  * DataAlertEvent constructor
  *
  * @param RequestExecutorInterface $executor Request executor object
  * @param SocketInterface          $socket Socket for this request
  * @param mixed                    $context Any optional user data for event
  * @param int                      $attempt Current attempt from 1
  * @param int                      $totalAttempts Total amount of attempts
  */
 public function __construct(RequestExecutorInterface $executor, SocketInterface $socket, $context, $attempt, $totalAttempts)
 {
     parent::__construct($executor, $socket, $context, EventType::DATA_ALERT);
     $this->totalAttempts = $totalAttempts;
     $this->attempt = $attempt;
 }
コード例 #2
0
ファイル: WriteEvent.php プロジェクト: edefimov/async-sockets
 /**
  * Constructor
  *
  * @param WriteOperation           $operation Operation, which will be used in I/O
  * @param RequestExecutorInterface $executor Request executor object
  * @param SocketInterface          $socket   Socket for this request
  * @param mixed                    $context  Any optional user data for event
  */
 public function __construct(WriteOperation $operation, RequestExecutorInterface $executor, SocketInterface $socket, $context)
 {
     parent::__construct($executor, $socket, $context, EventType::WRITE);
     $this->operation = $operation;
 }
コード例 #3
0
ファイル: ReadEvent.php プロジェクト: edefimov/async-sockets
 /**
  * Constructor
  *
  * @param RequestExecutorInterface $executor Request executor object
  * @param SocketInterface          $socket Socket for this request
  * @param mixed                    $context Any optional user data for event
  * @param FrameInterface           $frame Network data for read operation
  * @param bool                     $isOutOfBand Flag if data are out of band
  */
 public function __construct(RequestExecutorInterface $executor, SocketInterface $socket, $context, FrameInterface $frame, $isOutOfBand = false)
 {
     parent::__construct($executor, $socket, $context, $isOutOfBand ? EventType::OOB : EventType::READ);
     $this->frame = $frame;
 }