Amp\Iterator\fromIterable

function fromIterable(array|Traversable $iterable, int $delay = 0): Amp\Iterator

Creates an iterator from the given iterable, emitting the each value. The iterable may contain promises. If any promise fails, the iterator will fail with the same reason.

Type Parameter Description Default Value
array|Traversable $iterable Elements to emit. none
int $delay Delay between element emissions in milliseconds. none