-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support for async interface #115
Comments
It's certainly possible. At the moment it uses https://erlang.org/doc/man/gen_server.html#reply-2 to make synchronous responses. Do you have an existing asynch API in mind? |
I'm thinking that inside the request options to add:
And when Once the response is available the process indicated in
#{status := 200,
headers := RespHeaders,
cookiejar := CookieJar,
body := RespBody} or whatever What do you think ? Silviu |
Cool so basically something like https://github.com/benoitc/hackney#get-a-response-asynchronously 👍 |
@puzza007 I honestly inspired myself from https://github.com/lpgauth/buoy . Difference is that in buoy you get on single message at the end of the response with the response. In hackney you get multiple messages progressively like: when you get the headers, when you get the body and one at the final... This makes most of the use cases complicated because you have to aggregate yourself everything and when the done response comes you know you have the response. |
Cool. I've started a branch with some very early work. I haven't got it running yet. |
Hello,
Right now the API provides only methods that blocks the current process until the response is received. Can you add API's that sends the response when is ready to a specified PID ?
Silviu
The text was updated successfully, but these errors were encountered: