-
Notifications
You must be signed in to change notification settings - Fork 7.6k
1.x: Observable.ignoreElementsThen #3443
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
Conversation
.toList().toBlocking().single()); | ||
assertTrue(firstCompleted.get()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also add a test to see if the source ignored emits an error and the other is not even subscribed. I'd do this in case one decides to write an operator directly for this use case instead of using concat.
Looks good but it may be confusing to users when they encounter this and |
Those operators are a little bit different and even though In terms of using |
Extra test has been added, thanks @akarnokd |
This operates very similarly to #3430
@abersnaze @akarnokd preferences? I vote for option 3 above. |
I think one thing that should drive this decision is how often the functionality of |
Tough. I don't have any use case that would require throwing an error if the first source happens to be non-empty and even if were so, I'd use |
How about |
Sounds good to me. |
Unfortunately |
I vote for number 3 with the option to drop/onError when onNext is called. |
I prefer #1 without a rename of |
So far we have 3 totally different proposals and no consensus.
Option 2 above gives us both behaviors with a unified name. I vote for a variation of 2...
public Observable<R> andThen(Observable<R> doNext);
public Observable<R> andThen(Values doForValues, Observable<R> doNext);
public enum Values { Ignore, Error } example callsite... return inputs.publish(is ->
doSomeWork(Values.Ignore, is).andThen(is).retryWhen(this::tryRetry)
); Thoughts? I'd like to close the books on these 2 PRs. |
Or instead of an overload I'd be okay with adding a |
As mentioned above
|
The method name sounds fine to me. I'm thinking about the API of a On Fri, Dec 4, 2015, 20:05 Dave Moten [email protected] wrote:
|
I'm sounding a bit repetitive but nothing about 'andThen' suggests that it On Sun, 6 Dec 2015 09:48 Aaron Tull [email protected] wrote:
|
@davidmoten I'm really not concerned with the name that much. I think that it's fairly clear. What I'd really like to see happen is this...
The usage of this would look like this. public Observable<T> writeData(Observable<T> inputs) {
return inputs.publish(i -> {}
Completable work = database.insert(i).doOnNext(this::logQuery).none();
return results.concat(i);
});
} This reduces Now that #3444 is merged we could add these 2 methods. |
That sounds ok On Tue, 8 Dec 2015 10:05 Aaron Tull [email protected] wrote:
|
Great. I like this better as well. @abersnaze @akarnokd - do you guys agree with this approach? |
I don't particularly like |
Next step would be to implement |
I opened a PR adding |
@NiteshKant is this an acceptable resolution to your PR #3430? Can that PR be closed? |
Since Completable now has an option to append an Observable I think this PR can be closed. Please comment if it needs to be reopened. |
As discussed in #3113.
I also considered on a consistency basis calling it
ignoreElementsWith
but I don't think it carries the same clarity of meaning likestartWith
orconcatWith
. "ignore" and "then" seems to be a more natural combination in English to capture the sequential nature.