PHP Trait Amp\Internal\Producer

Note that it is the responsibility of the user of this trait to ensure that subscribers have a chance to subscribe first before emitting values.
Inheritance: use trait Placeholder
Show file Open project: amphp/amp

Public Methods

Method Description
complete ( )
subscribe ( callable $onNext )

Private Methods

Method Description
emit ( mixed $value ) : Promise Emits a value from the observable. The returned promise is resolved with the emitted value once all subscribers have been invoked.
resolve ( mixed $value = null ) Resolves the observable with the given value.

Method Details

complete() public method

public complete ( )

subscribe() public method

public subscribe ( callable $onNext )
$onNext callable