-
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
2.x: Completable class for valueless event composition. #3439
Conversation
I'm adding unit tests and some fixes, stay tuned. |
9fd5b65
to
1c1a6cf
Compare
Added 240 unit tests and fixed a few bugs. |
1c1a6cf
to
e824aff
Compare
I've added |
import io.reactivex.Completable.*; | ||
import io.reactivex.disposables.*; | ||
|
||
public final class CompletableOnSubscribeConcatArray implements CompletableOnSubscribe { |
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.
@akarnokd do you really see much sense in a separate class for arrays?
You can provide an override where passed array will be wrapped into ArrayList
and then passed to the CompletableOnSubscribeConcatIterable
.
Less code — less bugs :)
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.
Less allocation, more performant code.
What is the difference between Hope this helps. Just ignore me if you think that this is non sense. I see that @akarnokd are doing amazing things this days (specially rxjava v2), I'm not try to say that this pull request is bad or something similar. |
The difference is that, among other things, you don't have to drag around a mute type parameter. Null values are forbidden with 2.x and Reactive-Streams anyway. |
Consider making |
I've started out with |
Well that really sucks that |
You can't have wildcards as the type parameter of the super type. |
:( Oh well. |
Is there any chance we will get this with RxJava 1.x? |
The PR for 1.x has already been merged and should appear in 1.1.1 |
see #3444 |
Closing, will be included in the complete backport PR. |
I saw this mentioned in this talk from @benjchristensen
This PR adds a new class
Completable
which allows composing eventsthat never want to fire
onNext
, but onlyonError
oronComplete
. Itis built upon the same Reactive-Streams principles as
Single
,NbpObservable
andObservable
.I've added most methods that made sense and left out the others (such as
map
andflatMap
) that would require at least a single value.Depending on whether this type is actually required, I'll add unit test to this PR or in a new PR in case this gets merged.