-
Notifications
You must be signed in to change notification settings - Fork 39
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
Disallow implicit blocking operators of Project Reactor's Flux #468
Labels
Milestone
Comments
See #472 (comment) for some discussion on the approach to take here. |
benhalasi
added a commit
to benhalasi/error-prone-support
that referenced
this issue
Jan 23, 2023
rickie
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Jan 25, 2023
rickie
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Jan 25, 2023
benhalasi
added a commit
to benhalasi/error-prone-support
that referenced
this issue
Jan 29, 2023
benhalasi
added a commit
to benhalasi/error-prone-support
that referenced
this issue
Jan 29, 2023
benhalasi
added a commit
to benhalasi/error-prone-support
that referenced
this issue
Jan 31, 2023
benhalasi
added a commit
to benhalasi/error-prone-support
that referenced
this issue
Jan 31, 2023
rickie
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Feb 8, 2023
rickie
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Feb 8, 2023
Stephan202
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Feb 18, 2023
Stephan202
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Feb 18, 2023
rickie
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Feb 20, 2023
rickie
pushed a commit
to benhalasi/error-prone-support
that referenced
this issue
Feb 20, 2023
Thanks @benhalasi , @rickie , @Stephan202 ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Excessive blocking is a known pitfall in reactive programming. Some of Reactor's blocking operators are quite explicit about their behavior, e.g.
Mono#block
andFlux#blockFirst
, leaving no doubt that the operation is in fact blocking.This does not apply to two of the convenience methods exposed by Reactor's
Flux
, Flux#toStream and Flux#toIterable. These operators are documented to block, but this is not apparent from the method signature. It is easy to miss that the operation is blocking despite any potential lazy consumption of the resultingStream
orIterable
.Description of the proposed new feature
We should rewrite the problematic operators in terms of explicitly blocking operators, highlighting actual behavior.
Focusing first on the stream, I would like to rewrite the following code:
to:
To be determined what a general rewrite for
Flux#toIterable
would look like, or if this is actually desirable.Considerations
Participation
Willing, sure! Less sure on able. Would be happy to see anyone else submit a pull request to this effect. :D
The text was updated successfully, but these errors were encountered: