1 | <?php |
||
24 | class MultiCallQueue implements MultiCallQueueInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var RemoteAdapterInterface |
||
28 | */ |
||
29 | protected $remoteAdapter = null; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $queue = null; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | protected $position = 0; |
||
40 | |||
41 | /** |
||
42 | * @param RemoteAdapterInterface $remoteAdapter |
||
43 | */ |
||
44 | public function __construct(RemoteAdapterInterface $remoteAdapter) |
||
50 | |||
51 | /** |
||
52 | * @param ActionInterface $action |
||
53 | * @param callable $callback |
||
54 | * |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function addAction(ActionInterface $action, $callback = null) |
||
66 | |||
67 | /** |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function flush() |
||
76 | |||
77 | /** |
||
78 | * @return array |
||
79 | */ |
||
80 | public function execute() |
||
88 | |||
89 | /** |
||
90 | * (PHP 5 >= 5.0.0)<br/> |
||
91 | * Return the current element |
||
92 | * |
||
93 | * @link http://php.net/manual/en/iterator.current.php |
||
94 | * @return mixed Can return any type. |
||
95 | */ |
||
96 | public function current() |
||
100 | |||
101 | /** |
||
102 | * (PHP 5 >= 5.0.0)<br/> |
||
103 | * Move forward to next element |
||
104 | * |
||
105 | * @link http://php.net/manual/en/iterator.next.php |
||
106 | * @return void Any returned value is ignored. |
||
107 | */ |
||
108 | public function next() |
||
112 | |||
113 | /** |
||
114 | * (PHP 5 >= 5.0.0)<br/> |
||
115 | * Return the key of the current element |
||
116 | * |
||
117 | * @link http://php.net/manual/en/iterator.key.php |
||
118 | * @return integer scalar on success, or null on failure. |
||
119 | */ |
||
120 | public function key() |
||
124 | |||
125 | /** |
||
126 | * (PHP 5 >= 5.0.0)<br/> |
||
127 | * Checks if current position is valid |
||
128 | * |
||
129 | * @link http://php.net/manual/en/iterator.valid.php |
||
130 | * @return boolean The return value will be casted to boolean and then evaluated. |
||
131 | * Returns true on success or false on failure. |
||
132 | */ |
||
133 | public function valid() |
||
137 | |||
138 | /** |
||
139 | * (PHP 5 >= 5.0.0)<br/> |
||
140 | * Rewind the Iterator to the first element |
||
141 | * |
||
142 | * @link http://php.net/manual/en/iterator.rewind.php |
||
143 | * @return void Any returned value is ignored. |
||
144 | */ |
||
145 | public function rewind() |
||
149 | |||
150 | /** |
||
151 | * (PHP 5 >= 5.0.0)<br/> |
||
152 | * Whether a offset exists |
||
153 | * |
||
154 | * @link http://php.net/manual/en/arrayaccess.offsetexists.php |
||
155 | * |
||
156 | * @param mixed $offset <p> |
||
157 | * An offset to check for. |
||
158 | * </p> |
||
159 | * |
||
160 | * @return boolean true on success or false on failure. |
||
161 | * </p> |
||
162 | * <p> |
||
163 | * The return value will be casted to boolean if non-boolean was returned. |
||
164 | */ |
||
165 | public function offsetExists($offset) |
||
169 | |||
170 | /** |
||
171 | * (PHP 5 >= 5.0.0)<br/> |
||
172 | * Offset to retrieve |
||
173 | * |
||
174 | * @link http://php.net/manual/en/arrayaccess.offsetget.php |
||
175 | * |
||
176 | * @param mixed $offset <p> |
||
177 | * The offset to retrieve. |
||
178 | * </p> |
||
179 | * |
||
180 | * @return mixed Can return all value types. |
||
181 | */ |
||
182 | public function offsetGet($offset) |
||
186 | |||
187 | /** |
||
188 | * (PHP 5 >= 5.0.0)<br/> |
||
189 | * Offset to set |
||
190 | * |
||
191 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
||
192 | * |
||
193 | * @param mixed $offset <p> |
||
194 | * The offset to assign the value to. |
||
195 | * </p> |
||
196 | * @param mixed $value <p> |
||
197 | * The value to set. |
||
198 | * </p> |
||
199 | * |
||
200 | * @return void |
||
201 | */ |
||
202 | public function offsetSet($offset, $value) |
||
206 | |||
207 | /** |
||
208 | * (PHP 5 >= 5.0.0)<br/> |
||
209 | * Offset to unset |
||
210 | * |
||
211 | * @link http://php.net/manual/en/arrayaccess.offsetunset.php |
||
212 | * |
||
213 | * @param mixed $offset <p> |
||
214 | * The offset to unset. |
||
215 | * </p> |
||
216 | * |
||
217 | * @return void |
||
218 | */ |
||
219 | public function offsetUnset($offset) |
||
223 | |||
224 | /** |
||
225 | * (PHP 5 >= 5.1.0)<br/> |
||
226 | * Count elements of an object |
||
227 | * |
||
228 | * @link http://php.net/manual/en/countable.count.php |
||
229 | * @return int The custom count as an integer. |
||
230 | * </p> |
||
231 | * <p> |
||
232 | * The return value is cast to an integer. |
||
233 | */ |
||
234 | public function count() |
||
238 | } |
||
239 |