/** * 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; }
/** * 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; }
/** * 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; }