emit($value); }; /** * Completes the stream with the given value. * * @param mixed $value */ $resolve = function ($value = null) { $this->resolve($value); }; /** * Fails the stream with the given exception. * * @param \Throwable $reason */ $fail = function (\Throwable $reason) { $this->fail($reason); }; $producer($emit, $resolve, $fail); } }