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

fix: async reply for expired requests #61

Closed
wants to merge 1 commit into from

Conversation

zmstone
Copy link
Member

@zmstone zmstone commented Jan 13, 2025

prior to this fix, callback style async requests are not replied if a request is expired.
fixed to always evaluate the callback, but do not send reply for gen_server calls.

src/ehttpc.erl Outdated
%% delivered to self()'s mailbox
%% or the stream process might send more messages
%% before receiving the cancel message.
_ = gun:cancel(Client, StreamRef),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: since we now send just {error, expired} to the callback, without the late response, shouldn't we still cancel the stream?

prior to this fix, callback style async requests are not replied
if a request is expired.
fixed to always evaluate the callback, but do not send reply for
gen_server calls.
@zmstone zmstone force-pushed the 250113-maybe-reply-expired-for-callbacks branch from fa2c4a2 to 909d307 Compare January 16, 2025 13:16
@zmstone
Copy link
Member Author

zmstone commented Jan 17, 2025

the async callback is actually always evaluated even after the request is expired.

@zmstone zmstone closed this Jan 17, 2025
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.

2 participants