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 | * Flag if data are out of band |
||
31 | * |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $isOutOfBand; |
||
35 | |||
36 | /** |
||
37 | * Constructor |
||
38 | * |
||
39 | * @param RequestExecutorInterface $executor Request executor object |
||
40 | * @param SocketInterface $socket Socket for this request |
||
41 | * @param mixed $context Any optional user data for event |
||
42 | * @param FrameInterface $frame Network data for read operation |
||
43 | * @param bool $isOutOfBand Flag if data are out of band |
||
44 | */ |
||
45 | 51 | public function __construct( |
|
46 | RequestExecutorInterface $executor, |
||
47 | SocketInterface $socket, |
||
48 | $context, |
||
49 | FrameInterface $frame, |
||
50 | $isOutOfBand = false |
||
51 | ) { |
||
52 | 51 | parent::__construct($executor, $socket, $context, EventType::READ); |
|
53 | 51 | $this->frame = $frame; |
|
54 | 51 | $this->isOutOfBand = $isOutOfBand; |
|
55 | 51 | } |
|
56 | |||
57 | /** |
||
58 | * Return response frame |
||
59 | * |
||
60 | * @return FrameInterface |
||
61 | */ |
||
62 | 9 | public function getFrame() |
|
66 | |||
67 | /** |
||
68 | * Return true, if frame in this event is partial |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | 3 | public function isPartial() |
|
76 | |||
77 | /** |
||
78 | * Return true if data are out of band |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | 8 | public function isOutOfBand() |
|
86 | } |
||
87 |