Operation Sample with another Observable#566
Operation Sample with another Observable#566akarnokd wants to merge 1 commit intoReactiveX:masterfrom
Conversation
|
RxJava-pull-requests #495 SUCCESS |
That seems rather odd. It could potentially leave something dangling forever. |
|
I don't know the reason for this behavior in Rx.NET, but it isn't the first instance (i.e., SkipUntil). Maybe the intention was to sample both the onNext and onCompleted; if no more sampler, no more samples of onNext or onCompleted. In addition, it samples values only once, so unless a new source value appears, the sampler won't emit the last value. |
|
@headinthebox Why does it behave this way? |
|
The overload with sampler was introduced as we went through the API and changed everything that took time and added an overload that takes an Observable. When you sample using interval d, it is as if you are giving it an infinite Observable.interval(d). However, it would make sense if it behaved like zip where the result stream terminates when either of the input stream terminates or throws. Nice catch. |
|
What is the issue with SkipUntil? That one throws when "other" throw, and skips until it produces a regular value. It ignores onCompleted. |
|
I'll change the code to behave like zip. SkipUntil: I usually scratch my head when I see an operator returning an Observable which never terminates. |
Issue #74
Added missing
Observable.sample(Observable<U> sampler).