| 1 | <?php |
||
| 20 | class ReadEvent extends IoEvent |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Data read from network |
||
| 24 | * |
||
| 25 | * @var FrameInterface |
||
| 26 | */ |
||
| 27 | private $frame; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Constructor |
||
| 31 | * |
||
| 32 | * @param RequestExecutorInterface $executor Request executor object |
||
| 33 | * @param SocketInterface $socket Socket for this request |
||
| 34 | * @param mixed $context Any optional user data for event |
||
| 35 | * @param FrameInterface $frame Network data for read operation |
||
| 36 | */ |
||
| 37 | 39 | public function __construct( |
|
| 38 | RequestExecutorInterface $executor, |
||
| 39 | SocketInterface $socket, |
||
| 40 | $context, |
||
| 41 | FrameInterface $frame |
||
| 42 | ) { |
||
| 43 | 39 | parent::__construct($executor, $socket, $context, EventType::READ); |
|
| 44 | 39 | $this->frame = $frame; |
|
| 45 | 39 | } |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Return response frame |
||
| 49 | * |
||
| 50 | * @return FrameInterface |
||
| 51 | */ |
||
| 52 | 4 | public function getFrame() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Return true, if frame in this event is partial |
||
| 59 | * |
||
| 60 | * @return bool |
||
| 61 | */ |
||
| 62 | 3 | public function isPartial() |
|
| 66 | } |
||
| 67 |