{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4811","repository_url":"https://api.github.com/repos/ReactiveX/RxJava","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4811/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4811/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4811/events","html_url":"https://github.com/ReactiveX/RxJava/issues/4811","id":187509282,"number":4811,"title":"doOnDispose() vs doOnUnsubscribe()","user":{"login":"julioromano","id":1273124,"avatar_url":"https://avatars3.githubusercontent.com/u/1273124?v=4","gravatar_id":"","url":"https://api.github.com/users/julioromano","html_url":"https://github.com/julioromano","followers_url":"https://api.github.com/users/julioromano/followers","following_url":"https://api.github.com/users/julioromano/following{/other_user}","gists_url":"https://api.github.com/users/julioromano/gists{/gist_id}","starred_url":"https://api.github.com/users/julioromano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julioromano/subscriptions","organizations_url":"https://api.github.com/users/julioromano/orgs","repos_url":"https://api.github.com/users/julioromano/repos","events_url":"https://api.github.com/users/julioromano/events{/privacy}","received_events_url":"https://api.github.com/users/julioromano/received_events","type":"User","site_admin":false},"labels":[{"id":480313802,"url":"https://api.github.com/repos/ReactiveX/RxJava/labels/2.x","name":"2.x","color":"af40af","default":false},{"id":24234455,"url":"https://api.github.com/repos/ReactiveX/RxJava/labels/Question","name":"Question","color":"cc317c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-05T17:12:02Z","updated_at":"2017-07-21T12:48:29Z","closed_at":"2016-12-15T12:10:14Z","body":"While migrating some code from 1.2.x to 2.0 I've noticed a difference:\r\n\r\n- **1.2.x** : `Observable.doOnUnsubscribe()` is always called whenever an observable chain terminates, either because it's been explicitly terminated with `Subscription.unsubscribe()` or because `onComplete()` or `onError()` have been called.\r\nThis is the way I usually used to insert side effects on chain termination.\r\n\r\n - **2.x** : there is no `Observable.doOnUnsubscribe()` so I've resorted using `Observable.doOnDispose()` instead but this one is called only when explicitly terminating an observable chain with `Disposable.dispose();` \r\n\r\nI'm assuming this difference is intended (i.e. not a bug) so how can we 'insert' side effects on chain termination with RxJava 2.0?"},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments/316992006","html_url":"https://github.com/ReactiveX/RxJava/issues/4811#issuecomment-316992006","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/4811","id":316992006,"user":{"login":"akarnokd","id":1269832,"avatar_url":"https://avatars2.githubusercontent.com/u/1269832?v=4","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"created_at":"2017-07-21T12:48:29Z","updated_at":"2017-07-21T12:48:29Z","body":"I've updated the wiki."}}
{"actor":{"display_login":"akarnokd"}}