Amp\Emitter class Emitter

Emitter is a container for an iterator that can emit values using the emit() method and completed using the complete() and fail() methods of this object. The contained iterator may be accessed using the iterate() method. This object should not be part of a public API, but used internally to create and emit values to an iterator.

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct()
No documentation.
iterate — public function iterate(): Amp\Promise
No documentation.
emit — public function emit(mixed $value): Amp\Promise

Emits a value to the iterator.

Type Parameter Description Default Value
mixed $value No documentation. none
complete — public function complete()

Completes the iterator.

fail — public function fail(Throwable $reason)

Fails the iterator with the given reason.

Type Parameter Description Default Value
Throwable $reason No documentation. none
advance — public function advance(): Amp\Promise

{@inheritdoc}

getCurrent — public function getCurrent()

{@inheritdoc}