-
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
add Subscribers.wrap #3065
add Subscribers.wrap #3065
Conversation
subscriber.onCompleted(); | ||
} | ||
}); | ||
observable.unsafeSubscribe(Subscribers.from(subscriber)); |
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.
This calls from
but it should be wrap
.
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.
erk, thanks!
I'm trying to remind myself what in these cases we can't just pass the subscriber through if we're not actually changing any behavior. Unsubscription will propagate up and down, so it's not decoupling anything. So why must we allocate and wrap in these use cases? |
Double call of onStart was one reason. On Tue, 14 Jul 2015 07:08 Ben Christensen [email protected] wrote:
|
ccb7d5f
to
a0998b9
Compare
used |
Ah right. So |
child.onCompleted(); | ||
} | ||
}; | ||
return Subscribers.wrap(child); |
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.
This one is less obvious as to why it needs to be wrapped. The duplicate onStart
problem seems like something we should fix inside Subscriber
rather than needing to object allocate and wrap.
Add utility method to
Subscribers
to perform this common use case:Naming briefly discussed in #3057.