Skip to content
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

Async operations #32

Open
simPod opened this issue Nov 3, 2021 · 1 comment
Open

Async operations #32

simPod opened this issue Nov 3, 2021 · 1 comment
Assignees
Labels
enhancement A feature or improvement

Comments

@simPod
Copy link
Collaborator

simPod commented Nov 3, 2021

Is your feature request related to a problem? Please describe.

I'm loading several pages from graphql api and need to do it asynchronously in order to make it faster

Describe the solution you'd like

Still am not sure. Investigating, though it seems it would need a large rework.


I'm calling gql api using PSR Request through async client. Trying to do the same with Sailor is not possible rn.

E.g. Symfony HTTP client has async requests by default but Response makes it blocking since it reads status code and contents right after calling client.

sailor/src/Response.php

Lines 38 to 47 in 44678a8

public static function fromResponseInterface(ResponseInterface $response): self
{
if ($response->getStatusCode() !== 200) {
throw new InvalidResponseException("Response must have status code 200, got: {$response->getStatusCode()}");
}
return self::fromJson(
$response->getBody()->getContents()
);
}

@spawnia spawnia added the enhancement A feature or improvement label Nov 3, 2021
@spawnia
Copy link
Owner

spawnia commented Nov 3, 2021

I am not planning to work on this any time soon, but am open to reviewing possible desgins or a merge request. Also, I am not afraid of breaking changes, given this library is pre-v1.

@simPod simPod self-assigned this Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants