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

[rxjava-android] OperationObserveFromAndroidComponent #458

Merged
merged 8 commits into from
Oct 31, 2013
Merged

[rxjava-android] OperationObserveFromAndroidComponent #458

merged 8 commits into from
Oct 31, 2013

Conversation

mttkay
Copy link
Contributor

@mttkay mttkay commented Oct 29, 2013

This is in reference to https://github.com/soundcloud/RxJava/issues/1

Android applications can use this operator to safely observe a source sequence on the main user interface thread. As long as the subscription is unsubscribed from in onDestroy or onDetach, no resource leaks will occur.

I have also added an AndroidObservable class which acts as an entry point for instantiating Android specific observer instances.

@cloudbees-pull-request-builder

RxJava-pull-requests #377 FAILURE
Looks like there's a problem with this pull request

@mttkay
Copy link
Contributor Author

mttkay commented Oct 29, 2013

The build failed with an OOM while compiling the Scala module. Might just be a configuration issue.

@benjchristensen
Copy link
Member

Regarding CloudBees ... I've been trying to increment the memory high enough to get builds working ... still no luck. I may need to get CloudBees support to help.

benjchristensen added a commit that referenced this pull request Oct 31, 2013
[rxjava-android] OperationObserveFromAndroidComponent
@benjchristensen benjchristensen merged commit 0357377 into ReactiveX:master Oct 31, 2013
@gyulavoros
Copy link

@mttkay Would it make sense, to change OnSubscribeBase<T, AndroidComponent>.isComponentValid() implementation to return !activity.isFinishing() in case of an Activity? I can send a pull request if you confirm.

@mttkay
Copy link
Contributor Author

mttkay commented Nov 4, 2013

Hi,

we used to have this but decided it doesn't make sense. You might find more
information in the GH issue history.

IIRC the reason was that since the client needs to unsubscribe in
onDestroy anyway, and since isFinishing is only meaningful during
onPause, it doesn't really add any value to have this check. It's pretty
obvious that you're finishing the activity if onDestroy is called, and as
long as you call unsubscribe in onDestroy, all is good.

On Mon, Nov 4, 2013 at 11:45 AM, Vörös Gyula [email protected]:

@mttkay https://github.com/mttkay Would it make sense, to change
OnSubscribeBase.isComponentValid() implementation to return
!activity.isFinishing() in case of an Activity? I can send a pull request
if you confirm.


Reply to this email directly or view it on GitHubhttps://github.com//pull/458#issuecomment-27676781
.

rickbw pushed a commit to rickbw/RxJava that referenced this pull request Jan 9, 2014
…-operator

[rxjava-android] OperationObserveFromAndroidComponent
jihoonson pushed a commit to jihoonson/RxJava that referenced this pull request Mar 6, 2020
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.

4 participants