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

2.x: add subjects for Single, Maybe and Completable #4967

Merged
merged 2 commits into from
Jan 8, 2017

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Jan 6, 2017

This PR adds 3 new subject types: SingleSubject, MaybeSubject and CompletableSubject. 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 other Subjects.

@akarnokd akarnokd added this to the 2.1 milestone Jan 6, 2017
@codecov-io
Copy link

codecov-io commented Jan 6, 2017

Current coverage is 95.56% (diff: 96.83%)

Merging #4967 into 2.x will decrease coverage by 0.08%

@@                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   

Powered by Codecov. Last update b917754...d272533

* Creates a fresh CompletableSubject.
* @return the new CompletableSubject instance
*/
public static CompletableSubject create() {
Copy link
Collaborator

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();
Copy link
Collaborator

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();
Copy link
Collaborator

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

@akarnokd
Copy link
Member Author

akarnokd commented Jan 7, 2017

@vanniktech updated.

@akarnokd akarnokd merged commit d173b6d into ReactiveX:2.x Jan 8, 2017
@akarnokd akarnokd deleted the ExtraSubjects branch January 8, 2017 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants