final class Future (View source)

비동기 PortOne API 요청의 완료 상태와 결과를 다루는 객체입니다.

Methods

__construct(PromiseInterface $promise, callable|null $resolver = null)

비동기 요청 Promise와 선택적 응답 변환기를 보관하는 Future를 생성합니다.

bool
isComplete()

비동기 요청이 완료되었는지 확인합니다.

mixed
wait()

비동기 요청이 끝날 때까지 기다린 뒤 결과를 반환합니다. 요청 또는 응답 처리에 실패하면 해당 예외를 던집니다.

Details

__construct(PromiseInterface $promise, callable|null $resolver = null)

비동기 요청 Promise와 선택적 응답 변환기를 보관하는 Future를 생성합니다.

Parameters

PromiseInterface $promise
callable|null $resolver

bool isComplete()

비동기 요청이 완료되었는지 확인합니다.

Return Value

bool

mixed wait()

비동기 요청이 끝날 때까지 기다린 뒤 결과를 반환합니다. 요청 또는 응답 처리에 실패하면 해당 예외를 던집니다.

Return Value

mixed