-
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
SampleWithObservable broken? #912
Comments
I just found Thank you, regards, |
Tomáš - Did you get a definitive answer about this? I'm the fellah who put the -- David On Fri, Feb 21, 2014 at 6:52 AM, Tomas Dvorak notifications@github.comwrote:
David M. Gross |
No answer yet, but I hope that it will be the behavior that will get changed to match the marble diagram :) We'll see.. |
Hi. Both sample with time and sample with observable consume source values only once. Do you still need a sampler which returns the last seen value from source? |
I had to write a custom operator to do this (always emit the last value when sampler fires) so I'd appreciate this functionality being in the library. I'm not in a position to contribute my implementation sorry. |
So would this be an operator that emits the latest value on every tick? If so, it's not really |
Hi, On Tue, May 20, 2014 at 9:03 AM, Ben Christensen notifications@github.com
|
Unlike Fortunately, it is typically easy to roll your own, especially with the new Now in this particular case, doing a However, if you want to repeat values or do something else, you can always do that using |
OK. Just out of curiosity, can you sketch some simple usage scenario for On Sat, May 31, 2014 at 7:54 PM, headinthebox notifications@github.com
|
The http://introtorx.com/Content/v1.0.10621.0/13_TimeShiftedSequences.html#Sample |
Hmm. I have checked all three examples, but I'm still not convinced, that any of them requires precisely the behavior that is implemented by the current version of I have also noticed that the author of the the third example mentions that "My intuition was that if underlying feed does not produce a value during the sampling interval, “Sample” will repeat the most recent available value when sampling is due", that is, he was initially under the same impression as me. @DylanSale has posted a comment to this discussion stating that he also had the need the behavior I was describing, and had to implement it himself. The whole issue #1045 seems to be dealing with this once again, where, independently of me, @amazari also desires the behavior I have described. And I still have not found any use case requiring However, after this many comments on the topic and no sign of having convinced anybody, I feel like I'm just nitpicking too much, and I certainly don't want to do that. I really do appreciate all the work you put into RxJava and the open and collaborative way of development. @headinthebox has already posted a way to combine operators to achieve the desired behavior (thank you!), and if Best regards, |
@dvtomas, the power of a library is not in how many special-purpose operators it has that do exactly the job you want (i.e. how long the autocomplete list is when you hit It seems you are using Scala, so there it is really easy to add this operator yourself as an extension method and it will look as if it is a built-in operator. Unfortunately for Java we don't have that choice, so we need to be extra strict to keep the number of operators down and avoid to get an obese API. |
Hi all,
I'd expect
to return List(1, 1, 1), but it returns (as of As of RxJava 0.16.1) only List(1). Furthermore, it seems that there is no unit test in the source testing SampleWithObservable.
Thank you for any insights on this. Best regards,
Tomáš Dvořák
The text was updated successfully, but these errors were encountered: