Amp\Internal\Producer traitProducer

Trait used by Iterator implementations. Do not use this trait in your code, instead compose your class from one of the available classes implementing \Amp\Iterator.

Note that it is the responsibility of the user of this trait to ensure that listeners have a chance to listen first before emitting values.

Summary

Properties

Methods

Properties

$complete —privateAmp\Promise|null $complete
No documentation.
$values —privatearray $values =[]
No documentation.
$backPressure —privateAmp\Deferred[] $backPressure =[]
No documentation.
$position —privateint $position =-1
No documentation.
$waiting —privateAmp\Deferred|null $waiting
No documentation.
$resolutionTrace —privatenull|array $resolutionTrace
No documentation.

Methods

advance —public functionadvance():Amp\Promise

{@inheritdoc}

getCurrent —public functiongetCurrent()

{@inheritdoc}

emit —private functionemit(mixed$value):Amp\Promise

Emits a value from the iterator. The returned promise is resolved with the emitted value once all listeners have been invoked.

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

Completes the iterator.

fail —private functionfail(Throwable$exception)
No documentation.
Type Parameter Description Default Value
Throwable $exception No documentation. none