-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Window Operators Create Dangling Windows #1033
Comments
This was a conscious decision when implementing the operator: separate housekeeping of the window creation + emission was proving difficult... Simplifying this resulted in empty windows being emitted at the end of the sequence if it terminated with a separator, and in the case of Note that there can't be perfect alignment with Is there a strong argument for trying to get rid of these empty windows? Otherwise, might it be better covered by some added documentation (I tried to mention the empty window cases in each javadoc already)? |
I believe the emission of empty windows is a problem in that any expectation of the number of windows is now off-by-one. Imagine executing an SQL query RxJava's windowing operators don't have this tail window, and an example algorithm (functional, albeit non-optimal because of #1034) can be found in my r2dbc project. It is roughly:
|
Agree with @nebhale - you can't just cover with documentation some unexpected or wrong behavior b/c t is still risky for your users... An empty window is not exactly what you want to get during processing. |
@Kindrat in my opinion there is nothing inherently wrong with an empty window. It was even requested that the windowing-by-time operator emits empty windows so that it can be used as a heartbeat IIRC. You're unexpected behavior might be someone else's absolutely non-negotiable feature; but eh... @nebhale I don't expect it to be as simple as your combination of handle and processors, being a full blown operator, but we can give it a try, at least with the tail window. |
Offer and drain in all situations, even those where no emission. This results in subsequent separators or sequences that start with a separator to emit an empty window, but avoids a remainder window on source completion, when said window is empty.
Offer and drain in all situations, even those where no emission. This results in subsequent separators or sequences that start with a separator to emit an empty window, but avoids a remainder window on source completion, when said window is empty.
Offer and drain in all situations, even those where no emission. This results in subsequent separators or sequences that start with a separator to emit an empty window, but avoids a remainder window on source completion, when said window is empty.
Currently, when a
Flux
ends with a value that would close a window, another window is immediately opened, and closed without ever having an element provided. For example, the two following tests fail:I believe that windows should only be opened on the first element of a new window, which would cause these two tests to pass. This would have the added benefit of matching how the buffer operators behave.
The text was updated successfully, but these errors were encountered: