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

Implemented SerialSubscription and Timeout operator #434

Merged
merged 4 commits into from
Oct 22, 2013

Conversation

johnhmarks
Copy link
Contributor

Implemented Timeout operator and SerialSubscription upon which it is based.

@cloudbees-pull-request-builder

RxJava-pull-requests #345 SUCCESS
This pull request looks good

*
* @see <a href="http://msdn.microsoft.com/en-us/library/system.reactive.disposables.serialdisposable(v=vs.103).aspx">Rx.Net equivalent SerialDisposable</a>
*/
public class SerialSubscription implements Subscription {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this class is achieving the same as MultipleAssingmentSubscription. Can you take a look at it?

https://github.com/Netflix/RxJava/blob/master/rxjava-core/src/main/java/rx/subscriptions/MultipleAssignmentSubscription.java

No idea why I wrote such a horrible Javadoc on it that doesn't explain it well. From the MSDN doc it states: "Represents a disposable whose underlying disposable can be swapped for another disposable."

Your Javadoc description should replace the MultipleAssingmentSubscription one if I'm reading the code correctly and they do the same things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ben,

SerialSubscription and MultipleAssignmentSubscription are different things. MultipleAssignment simply enables you to swap out the underlying subscription in a thread-safe manner. Whereas, Serial unsubscribes from the previous underlying as you replace.

See:
http://msdn.microsoft.com/en-us/library/system.reactive.disposables.serialdisposable(v=vs.103).aspx
Vs:
http://msdn.microsoft.com/en-us/library/system.reactive.disposables.multipleassignmentdisposable(v=vs.103).aspx

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, cool.

@benjchristensen
Copy link
Member

Merging this as it functions and is well written and well documented and will then look at whether modifications based on #446 make sense.

benjchristensen added a commit that referenced this pull request Oct 22, 2013
Implemented SerialSubscription and Timeout operator
@benjchristensen benjchristensen merged commit b5ec461 into ReactiveX:master Oct 22, 2013
rickbw pushed a commit to rickbw/RxJava that referenced this pull request Jan 9, 2014
Implemented SerialSubscription and Timeout operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants