1 | <?php |
||
25 | class Loop implements LoopInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var BaseLoopInterface |
||
29 | */ |
||
30 | protected $loop = null; |
||
31 | |||
32 | /** |
||
33 | * @param BaseLoopInterface $loop |
||
34 | */ |
||
35 | public function __construct(BaseLoopInterface $loop = null) |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function addReadStream($stream, callable $listener) |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function addWriteStream($stream, callable $listener) |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function removeReadStream($stream) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function removeWriteStream($stream) |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function removeStream($stream) |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function timeout(callable $task, $delay) |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function timer(callable $task, $interval, $count = null) |
||
98 | |||
99 | /** |
||
100 | * @param callable $task |
||
101 | * |
||
102 | * @return PromiseInterface |
||
103 | */ |
||
104 | public function next(callable $task) |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function enqueue(callable $task) |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | public function tick() |
||
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | public function run() |
||
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | public function stop() |
||
146 | |||
147 | /** |
||
148 | * @return \React\EventLoop\LoopInterface |
||
149 | */ |
||
150 | protected function loop() |
||
154 | } |
||
155 |