-
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: add subjects for Single, Maybe and Completable #4967
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
|
* Creates a fresh CompletableSubject. | ||
* @return the new CompletableSubject instance | ||
*/ | ||
public static CompletableSubject create() { |
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.
Should this be annotated with @CheckReturnValue
?
|
||
@Test | ||
public void once() { | ||
CompletableSubject ms = CompletableSubject.create(); |
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.
should not all of those be cs
instead of ms
for MaybeSubject ?
|
||
@Test | ||
public void success() { | ||
SingleSubject<Integer> ms = SingleSubject.create(); |
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.
also here should be ss
@vanniktech updated. |
This PR adds 3 new subject types:
SingleSubject
,MaybeSubject
andCompletableSubject
. 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 otherSubject
s.