-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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 drop(skip) and dropRight(skipLast) to rxscala #1056
Conversation
RxJava-pull-requests #972 SUCCESS |
Please no dropRight! This API is so incompatible with reactive model, that I'd relay it to the user to subscribe and aggregate what he wants, rather than promoting this API to Observable. Just my 2c though. |
@vigdorchik What is your reason for this? Rx has had this operator for a very long time (called It is indeed not useful for infinite streams, but there are several operators like that including |
Ah, ok. My usecase was indeed infinite streams, and I wasn't prepared for finite case. If I were designing the API now, I would suggest Future instead of Observable for finite case, delegating to map on Lists, but it's again just me :) |
That is not as simple as you think. Which future to use? And also, Futures are hot, so this can subtely change the order of side effects. In other words |
This discussion comes up every so often about letting the type communicate things like finite vs infinite and scalar vs vector. It was discussed to some degree here: https://groups.google.com/d/topic/rxjava/MBtpYmUJauE/discussion In Rx.Net they have Beyond this comes the more nuanced arguments of whether a scalar response (which ultimately encompasses - or could encompass - finite streams that are aggregated down to a single response) should be typed differently. You can read the link above to see more on that and the compositional challenges it causes (types get lost quickly when composing). |
@headinthebox I see, Futures don't capture subscription. So it's not Future, but is it a full-blown Observable? |
Add drop(skip) and dropRight(skipLast) to rxscala
Not a problem for bringing it up ... it's an interesting one and one that doesn't have a clear answer. If you want to discuss it further, either revive the mailing list thread, or start a new Github Issue. |
+1. |
Is it true that skipLast() will cache "all items" until onCompleted (as the It seems that it shouldn't have to do such extensive cacheing. For On Mon, Apr 21, 2014 at 10:25 AM, headinthebox [email protected]:
David M. Gross |
I've been thinking about the timed skipLast and it could emit old enough elements in onNext and thus freeing up the internal buffer. |
@akarnokd Yes, I think we only need to cache the items in the specified time window. |
Please help review the new implementation #1065 |
No description provided.