Skip to content
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

Operator: Last #470

Merged
merged 2 commits into from
Nov 7, 2013
Merged

Conversation

benjchristensen
Copy link
Member

Adds Observable.last and fixes behavior of BlockingObservable.last based on email discussion with @headinthebox

Equivalent to lastAsync in Rx.Net.
It now throws an IllegalArgumentException instead of returning null if no elements are emitted.

This is based on feedback from @headinthebox confirming this expected behavior:

var xs = Observable.Range(1,0);                       		// empty sequence
int x = xs.Last().Dump();                             		// throws “sequence contains no elements”       RxJava => BlockingObservable.last()
IObservable<int> ys = xs.TakeLast(1).Dump();          // OnCompleted()                                                RxJava => Observable.takeLast(1)
IObservable<int> zs = xs.LastAsync().Dump();          // OnError(“sequence contains no elements”)    RxJava => Observable.last()
benjchristensen added a commit that referenced this pull request Nov 7, 2013
@benjchristensen benjchristensen merged commit 2a737ec into ReactiveX:master Nov 7, 2013
@cloudbees-pull-request-builder

RxJava-pull-requests #395 FAILURE
Looks like there's a problem with this pull request

@benjchristensen benjchristensen deleted the operator-last branch November 26, 2013 23:40
rickbw pushed a commit to rickbw/RxJava that referenced this pull request Jan 9, 2014
jihoonson pushed a commit to jihoonson/RxJava that referenced this pull request Mar 6, 2020
… instead of string for aggregating data of multiple instances,CircuitBreaker's | Retry's | BulkHead's or application's. (ReactiveX#471)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants