Changeset View
Changeset View
Standalone View
Standalone View
src/future/FutureIterator.php
| Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | public function rewind() { | ||||
| $this->next(); | $this->next(); | ||||
| } | } | ||||
| /** | /** | ||||
| * @task iterator | * @task iterator | ||||
| */ | */ | ||||
| public function next() { | public function next() { | ||||
| // See T13572. If we preivously resolved and returned a Future, release | // See T13572. If we previously resolved and returned a Future, release | ||||
| // it now. This prevents us from holding Futures indefinitely when callers | // it now. This prevents us from holding Futures indefinitely when callers | ||||
| // like FuturePool build long-lived iterators and keep adding new Futures | // like FuturePool build long-lived iterators and keep adding new Futures | ||||
| // to them. | // to them. | ||||
| if ($this->key !== null) { | if ($this->key !== null) { | ||||
| unset($this->futures[$this->key]); | unset($this->futures[$this->key]); | ||||
| $this->key = null; | $this->key = null; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines | |||||