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

✨ Add #extract_responses method [backport: #330] #337

Merged
merged 4 commits into from
Oct 13, 2024

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Oct 13, 2024

This backports #330 from master (0.5.0-dev).

While trying to track down the cause of #287 for @hsbt, I noticed that
this is likely a race condition.  While this can't be the cause of that
issue (the failures come from tests that don't even use FakeServer), it
seems like a good idea to fix anyway, and safe.
This is similar to ActiveSupport's Array#extract!.

Yields all of the unhandled #responses for a single response type.
Removes and returns the responses for which the block returns a true
value.

Extracting responses is synchronized with other threads.  The lock is
released before returning.
@nevans nevans merged commit e60cde6 into v0.4-stable Oct 13, 2024
26 checks passed
@nevans nevans deleted the backport/0.4/330/extract_responses branch October 13, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant