Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Don't works with aws-sdk-php #26

Closed
noerosell opened this issue Sep 27, 2017 · 2 comments
Closed

Don't works with aws-sdk-php #26

noerosell opened this issue Sep 27, 2017 · 2 comments

Comments

@noerosell
Copy link

noerosell commented Sep 27, 2017

The sign step Middleware that Aws (version 3) adds in every request concludes with a non fulfilled promise, short-cutting the middleware chain, so when an aws async method is requested, the invoke method of your HttpClientAdapter is not reached and the react loop queue remains empty.

This promise makes an http request (to validate credentials ?), and is added to guzzle internal queue. This promise will never resolve until run method queue's is executed.

You can see Aws\Middleware file signer method, where the promise is created, returned to Aws\CredentialProvider fromCredentials method.

In my point of view this is not a bug of react-guzzle-psr7, may be can be avoided adding another middleware step which runs the guzzle queue ?

@WyriHaximus
Copy link
Owner

Hey, I've just filed #27 that does this for when after the __invoke has been called. For before __invoke is called. You could do this, that will keep ticking off items from the queue ensuring everything is handled:

$timer = $this->loop->addPeriodicTimer(0.1, function () {
    \GuzzleHttp\Promise\queue()->run();
});

Be sure to cancel $timer when you don't have any left to do, or otherwise the loop keeps running.

@noerosell
Copy link
Author

Ok. Thanks.

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

No branches or pull requests

2 participants