Skip to content

Improve interoperability with reactphp/promise #31

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 9, 2018
Merged

Improve interoperability with reactphp/promise #31

merged 1 commit into from
Jan 9, 2018

Conversation

samuelnogueira
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #30
License MIT

What's in this PR?

$onFulfilled callables passed to Http\Adapter\React\Promise::then are no longer required to return the response.

Example Usage

/** @var \Http\Adapter\React\Client $client */
/** @var \Psr\Http\Message\RequestInterface $request */
$client->sendAsyncRequest($request)->then(function (\Psr\Http\Message\ResponseInterface $response) {
    echo $response->getBody();
});

@samuelnogueira
Copy link
Contributor Author

Closed and re-opened PR to trigger rebuild in travis-ci

@dbu
Copy link
Contributor

dbu commented Jan 8, 2018

its green now!

i am not familiar enough with react to tell if there could be issues with this. @shulard and @joelwurtz wdyt?

@joelwurtz
Copy link
Member

joelwurtz commented Jan 8, 2018

It's a little bit against the specification of async httplug , but okish

@dbu dbu merged commit 57f3696 into php-http:master Jan 9, 2018
@dbu
Copy link
Contributor

dbu commented Jan 9, 2018

thanks @samuelnogueira !

It's a little bit against the specification of async httplug , but okish

i guess thats more a complaint about what react is doing than what we do here in the adapter? if react defines it like this, we have to work with it i guess...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve interoperability with reactphp/promise
3 participants