{"action":"opened","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4646","repository_url":"https://api.github.com/repos/ReactiveX/RxJava","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4646/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4646/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4646/events","html_url":"https://github.com/ReactiveX/RxJava/issues/4646","id":180239281,"number":4646,"title":"Proposal: disposeOn ","user":{"login":"hzsweers","id":1361086,"avatar_url":"https://avatars.githubusercontent.com/u/1361086?v=3","gravatar_id":"","url":"https://api.github.com/users/hzsweers","html_url":"https://github.com/hzsweers","followers_url":"https://api.github.com/users/hzsweers/followers","following_url":"https://api.github.com/users/hzsweers/following{/other_user}","gists_url":"https://api.github.com/users/hzsweers/gists{/gist_id}","starred_url":"https://api.github.com/users/hzsweers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzsweers/subscriptions","organizations_url":"https://api.github.com/users/hzsweers/orgs","repos_url":"https://api.github.com/users/hzsweers/repos","events_url":"https://api.github.com/users/hzsweers/events{/privacy}","received_events_url":"https://api.github.com/users/hzsweers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-30T07:34:58Z","updated_at":"2016-09-30T07:34:58Z","closed_at":null,"body":"Wanted to put this up for discussion:\r\n\r\nAn active concern in Android is binding execution to the lifecycle of something (Activity, View, etc). Disposable in RxJava 2 looks potentially useful for this if there could be a way to conditionally dispose against a given lifecycle (potentially represented as another Flowable). It would look very similar to `takeUntil()`, but with disposable semantics (not calling anymore events, whereas takeUntil() completes). I'm not sure where this would fit, but wanted to put it up for discussion as I'm sure there's RxJava 2 semantics I'm missing. My proposal would be something as a sibling to `subscribeWith`. Taking the returned Disposable is ok, but not ideal as it can quickly involve wrapping long chains and playing LISP with finding the closing parens later.\r\n\r\nIdeally, we would be able to do something like this:\r\n\r\n```java\r\nsomeFlowable\r\n    ...\r\n    .disposeOn(lifecycle())\r\n```\r\n\r\nor if it's possible to keep it as an operator (though I'm guessing this is wishful thinking):\r\n\r\n```java\r\nsomeFlowable\r\n    ...\r\n    .disposeOn(lifecycle())\r\n    .subscribe(...)\r\n```"}}
{"actor":{"display_login":"hzsweers"}}