Skip to content

clarify wait #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface Promise
* The callback will be called when the value arrived and never more than once.
*
* @param callable $onFulfilled Called when a response will be available.
* @param callable $onRejected Called when an error happens.
* @param callable $onRejected Called when an exception occurs.
*
* @return Promise A new resolved promise with value of the executed callback (onFulfilled / onRejected).
*/
Expand All @@ -55,15 +55,17 @@ public function getState();
/**
* Wait for the promise to be fulfilled or rejected.
*
* When this method returns, the request has been resolved and the appropriate callable has terminated.
* When this method returns, the request has been resolved and if callables have been
* specified, the appropriate one has terminated.
*
* When called with the unwrap option, the value is resolved, but not returned.
* When $unwrap is true (the default), the response is returned, or the exception thrown
* on failure. Otherwise, nothing is returned or thrown.
*
* @param bool $unwrap Whether to return resolved value / throw reason or not
*
* @return ResponseInterface|null Resolved value, null if $unwrap is set to false
*
* @throws \Exception The rejection reason.
* @throws \Exception The rejection reason if $unwrap is set to true and the request failed.
*/
public function wait($unwrap = true);
}