Title: Hot and Cold observables - Disconnecting: Example output is not correct. · Issue #18 · Froussios/Intro-To-RxJava · GitHub
Open Graph Title: Hot and Cold observables - Disconnecting: Example output is not correct. · Issue #18 · Froussios/Intro-To-RxJava
X Title: Hot and Cold observables - Disconnecting: Example output is not correct. · Issue #18 · Froussios/Intro-To-RxJava
Description: Hi, Please check the code example here: ConnectableObservable
Open Graph Description: Hi, Please check the code example here: ConnectableObservable
X Description: Hi, Please check the code example here: ConnectableObservable<Long> connectable = Observable.interval(200, TimeUnit.MILLISECONDS).publish(); Subscription s = connectable.connect(); connectabl...
Opengraph URL: https://github.com/Froussios/Intro-To-RxJava/issues/18
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Hot and Cold observables - Disconnecting: Example output is not correct.","articleBody":"Hi,\nPlease check the code example [here](https://github.com/Froussios/Intro-To-RxJava/blob/master/Part%203%20-%20Taming%20the%20sequence/6.%20Hot%20and%20Cold%20observables.md#disconnecting):\n\n``` java\nConnectableObservable\u003cLong> connectable = Observable.interval(200, TimeUnit.MILLISECONDS).publish();\nSubscription s = connectable.connect();\n\nconnectable.subscribe(i -> System.out.println(i));\n\nThread.sleep(1000);\nSystem.out.println(\"Closing connection\");\ns.unsubscribe();\n\nThread.sleep(1000);\nSystem.out.println(\"Reconnecting\");\ns = connectable.connect();\n```\n\nThe actual output is:\n\n```\n0\n1\n2\n3\n4\nClosing connection\nReconnecting\n```\n\nNotice no more values appear after `Reconnecting`. Looks like calling `unsubscribe` on the `ConnectableObservable`'s subscription also terminates subsequent subscriptions, too. I need to call `connectable.subscribe(i -> System.out.println(i))` again in order to produce output while the text says that 'old observers will begin receiving values again' after calling `connect()` on the `ConnectableObservable` object. I'm using RxJava 1.0.14.\n","author":{"url":"https://github.com/huylv","@type":"Person","name":"huylv"},"datePublished":"2015-10-29T19:34:44Z","url":"https://github.com/Froussios/Intro-To-RxJava/issues/18"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f5130cd4-e7b2-be06-1f89-a26fa2b5786f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6BE:387370:1E2136:2B7D73:6AFC4B8E |
| html-safe-nonce | 7d1c1113619a33dd5b845bda6c8bc6adb23d7f6290ad3ce1a5194e1a5b0f658b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkJFOjM4NzM3MDoxRTIxMzY6MkI3RDczOjZBRkM0QjhFIiwidmlzaXRvcl9pZCI6IjIyMjI5MzEyMDk5Nzk5NzI0OTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | eeb2ede64287772ae633b734056b45a11a0e09717ccfabf5ce18f34ea23cb8b6 |
| hovercard-subject-tag | issue:114129394 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Froussios/Intro-To-RxJava/18/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7b259739158fe866d0b244539a135e056837c6c95111b86b127efdc7584f42ba/Froussios/Intro-To-RxJava/issues/18 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7b259739158fe866d0b244539a135e056837c6c95111b86b127efdc7584f42ba/Froussios/Intro-To-RxJava/issues/18 |
| og:image:alt | Hi, Please check the code example here: ConnectableObservable |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | huylv |
| hostname | github.com |
| expected-hostname | github.com |
| None | 20dfdada12bc00bbf8065dc10dfe3ff3711b85db5cc117f83296f8074e861960 |
| turbo-cache-control | no-preview |
| go-import | github.com/Froussios/Intro-To-RxJava git https://github.com/Froussios/Intro-To-RxJava.git |
| octolytics-dimension-user_id | 1633816 |
| octolytics-dimension-user_login | Froussios |
| octolytics-dimension-repository_id | 32989617 |
| octolytics-dimension-repository_nwo | Froussios/Intro-To-RxJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 32989617 |
| octolytics-dimension-repository_network_root_nwo | Froussios/Intro-To-RxJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 041909865f220ab51714e7efdc276dd349a99ade |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width