2.x: add subjects for Single, Maybe and Completable#4967
Merged
akarnokd merged 2 commits intoReactiveX:2.xfrom Jan 8, 2017
Merged
2.x: add subjects for Single, Maybe and Completable#4967akarnokd merged 2 commits intoReactiveX:2.xfrom
akarnokd merged 2 commits intoReactiveX:2.xfrom
Conversation
Current coverage is 95.56% (diff: 96.83%)@@ 2.x #4967 diff @@
==========================================
Files 587 591 +4
Lines 37671 37959 +288
Methods 0 0
Messages 0 0
Branches 5676 5756 +80
==========================================
+ Hits 36031 36276 +245
- Misses 696 717 +21
- Partials 944 966 +22
|
vanniktech
reviewed
Jan 7, 2017
| * Creates a fresh CompletableSubject. | ||
| * @return the new CompletableSubject instance | ||
| */ | ||
| public static CompletableSubject create() { |
Collaborator
There was a problem hiding this comment.
Should this be annotated with @CheckReturnValue ?
vanniktech
reviewed
Jan 7, 2017
|
|
||
| @Test | ||
| public void once() { | ||
| CompletableSubject ms = CompletableSubject.create(); |
Collaborator
There was a problem hiding this comment.
should not all of those be cs instead of ms for MaybeSubject ?
vanniktech
reviewed
Jan 7, 2017
|
|
||
| @Test | ||
| public void success() { | ||
| SingleSubject<Integer> ms = SingleSubject.create(); |
Member
Author
|
@vanniktech updated. |
JakeWharton
approved these changes
Jan 8, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds 3 new subject types:
SingleSubject,MaybeSubjectandCompletableSubject. Their purpose is to provide an imperative way to multicast 0-1-error events as well as cache these events for later observers. They are thread-safe by design and there is no need for a serialized wrapper unlike the otherSubjects.