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

request_ref guard #302

Open
Hentioe opened this issue Feb 19, 2025 · 1 comment
Open

request_ref guard #302

Hentioe opened this issue Feb 19, 2025 · 1 comment

Comments

@Hentioe
Copy link

Hentioe commented Feb 19, 2025

I use the following code to match Finch's asynchronous response:

@impl true
def handle_info({{pool, pid}, resp}, state)
      when pool in [Finch.HTTP1.Pool, Finch.HTTP2.Pool] and is_pid(pid) do
# todo...
end

However, since request_ref is opaque, there is no guarantee that this guard will always be reliable.

Could Finch provide a is_request_ref guard? After all, the structure of request_ref is usually only known to the maintainer.

@sneako
Copy link
Owner

sneako commented Feb 20, 2025

That sounds like a good idea to me. Please submit a PR!

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

No branches or pull requests

2 participants