-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Should flatMapLatest be buffered by default? #2546
Comments
Hi, we actually have a consistent policy regarding default buffering: if an operator can be buffered by design, then it always buffered and this fact is reflected in the documentation. It has both practical and historical reasons:
As an unfortunate side-effect, single-threaded flows (ones that emit and collect in e.g. |
Yeah, I can understand the thinking behind making |
Thanks for spotting, documentation to
We also have I've updated the doc and now Regarding |
For me it was really unexpected, because first it's not clear from the operator name that it's buffered, and second there's no other operators, that are buffered by default (not counting
flatMapLatest
and others, as they usetransformLatest
themselves).Here I was expecting it to collect 1, then 2, then cancel and receive the last 10 emit. But because
flatMapLatest
is buffered, there was 10 collects without cancellation.So the main question is - should
transformLatest
be buffered by default, or is it better to change it to be non-buffered to avoid confusion?The text was updated successfully, but these errors were encountered: