PHP 클래스 Amp\Coroutine

When a promise is yielded, execution of the generator is interrupted until the promise is resolved. A success value is sent into the generator, while a failure reason is thrown into the generator. Using a coroutine, asynchronous code can be written without callbacks and be structured like synchronous code.
상속: implements amp\Promise, use trait Amp\Internal\Placeholder
파일 보기 프로젝트 열기: amphp/amp 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Generator $generator )

비공개 메소드들

메소드 설명
dispose ( Throwable $exception ) Runs the generator to completion then fails the coroutine with the given exception.

메소드 상세

__construct() 공개 메소드

public __construct ( Generator $generator )
$generator Generator