{"action":"created","comment":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/comments/97776496","pull_request_review_id":18396293,"id":97776496,"diff_hunk":"@@ -0,0 +1,23 @@\n+package chat.rocket.android.helper;\n+\n+import java.util.concurrent.TimeUnit;\n+import rx.Observable;\n+import rx.Single;\n+import rx.functions.Func0;\n+import rx.functions.Func1;\n+\n+/**\n+ * Rx operator and so on.\n+ */\n+public class RxHelper {\n+  public static Func1<Observable<? extends Throwable>, Observable<?>> exponentialBackoff(\n+      int maxRetryCount, long base, TimeUnit unit) {\n+    return errors -> errors\n+        .zipWith(Observable.range(0, maxRetryCount), (error, retryCount) -> retryCount)","path":"app/src/main/java/chat/rocket/android/helper/RxHelper.java","position":null,"original_position":16,"commit_id":"e0440062af3e84dc0fa2e44612f9b36632993d13","original_commit_id":"0e0d18a576d09e98fcaa329bcf768087f60bf40c","user":{"login":"laggedHero","id":1779545,"avatar_url":"https://avatars.githubusercontent.com/u/1779545?v=3","gravatar_id":"","url":"https://api.github.com/users/laggedHero","html_url":"https://github.com/laggedHero","followers_url":"https://api.github.com/users/laggedHero/followers","following_url":"https://api.github.com/users/laggedHero/following{/other_user}","gists_url":"https://api.github.com/users/laggedHero/gists{/gist_id}","starred_url":"https://api.github.com/users/laggedHero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laggedHero/subscriptions","organizations_url":"https://api.github.com/users/laggedHero/orgs","repos_url":"https://api.github.com/users/laggedHero/repos","events_url":"https://api.github.com/users/laggedHero/events{/privacy}","received_events_url":"https://api.github.com/users/laggedHero/received_events","type":"User","site_admin":false},"body":"Yep. Sounds good. 👍 ","created_at":"2017-01-25T13:26:40Z","updated_at":"2017-01-25T13:26:40Z","html_url":"https://github.com/RocketChat/Rocket.Chat.Android/pull/170#discussion_r97776496","pull_request_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/comments/97776496"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat.Android/pull/170#discussion_r97776496"},"pull_request":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170","id":102433418,"html_url":"https://github.com/RocketChat/Rocket.Chat.Android/pull/170","diff_url":"https://github.com/RocketChat/Rocket.Chat.Android/pull/170.diff","patch_url":"https://github.com/RocketChat/Rocket.Chat.Android/pull/170.patch","issue_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/170","number":170,"state":"open","locked":false,"title":"introduce alternative WebSocket connectivity management","user":{"login":"YusukeIwaki","id":11763113,"avatar_url":"https://avatars.githubusercontent.com/u/11763113?v=3","gravatar_id":"","url":"https://api.github.com/users/YusukeIwaki","html_url":"https://github.com/YusukeIwaki","followers_url":"https://api.github.com/users/YusukeIwaki/followers","following_url":"https://api.github.com/users/YusukeIwaki/following{/other_user}","gists_url":"https://api.github.com/users/YusukeIwaki/gists{/gist_id}","starred_url":"https://api.github.com/users/YusukeIwaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YusukeIwaki/subscriptions","organizations_url":"https://api.github.com/users/YusukeIwaki/orgs","repos_url":"https://api.github.com/users/YusukeIwaki/repos","events_url":"https://api.github.com/users/YusukeIwaki/events{/privacy}","received_events_url":"https://api.github.com/users/YusukeIwaki/received_events","type":"User","site_admin":false},"body":"<!-- INSTRUCTION: Keep the line below to notify all core developers about this new PR -->\r\n@RocketChat/android\r\n\r\nCloses #147 \r\n\r\n<img src=\"https://cloud.githubusercontent.com/assets/11763113/22061001/63c044d4-ddb6-11e6-837e-f080e0eaf88f.png\" width=480>\r\n\r\n### ServerConfig is removed! \r\n\r\n* Now `ConnectivityManager` is responsible for the connectivity management.\r\n* `serverConfigId` is no longer used, `hostname` is used as a primary key for each model.\r\n\r\n### DDPClient#isConnected is removed!\r\n\r\n`DDPClient#isConnected` returns true often even after connection is disconnected. It was really confusing! ( #137 is caused by it)\r\nNow the function for checking connectivity is implemented with DDP ping-pong. It costs a little time, however it brings much more precise connectivity check.\r\n\r\n\r\n---\r\n\r\n### about RxJava usage...\r\n\r\nI couldn't find `flatMap` or its compatible operator in `rx.Completable` .\r\n( `andThen` looks similar but it doesn't evaluate item with laziness... ) So I used `Single<Boolean>` instead.","created_at":"2017-01-20T09:59:48Z","updated_at":"2017-01-25T13:26:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f89f7713456386ef22b392d19d408874b529b9fb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170/commits","review_comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170/comments","review_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/170/comments","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/statuses/e0440062af3e84dc0fa2e44612f9b36632993d13","head":{"label":"RocketChat:alternative_websocket_connection_management","ref":"alternative_websocket_connection_management","sha":"e0440062af3e84dc0fa2e44612f9b36632993d13","user":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"repo":{"id":48179404,"name":"Rocket.Chat.Android","full_name":"RocketChat/Rocket.Chat.Android","owner":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RocketChat/Rocket.Chat.Android","description":null,"fork":false,"url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android","forks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/forks","keys_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/teams","hooks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/hooks","issue_events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/events{/number}","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/events","assignees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/assignees{/user}","branches_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/branches{/branch}","tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/tags","blobs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/statuses/{sha}","languages_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/languages","stargazers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/stargazers","contributors_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/contributors","subscribers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/subscribers","subscription_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/subscription","commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/contents/{+path}","compare_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/merges","archive_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/downloads","issues_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues{/number}","pulls_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls{/number}","milestones_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/milestones{/number}","notifications_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/labels{/name}","releases_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/releases{/id}","deployments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/deployments","created_at":"2015-12-17T14:36:45Z","updated_at":"2017-01-23T01:45:57Z","pushed_at":"2017-01-25T12:59:40Z","git_url":"git://github.com/RocketChat/Rocket.Chat.Android.git","ssh_url":"git@github.com:RocketChat/Rocket.Chat.Android.git","clone_url":"https://github.com/RocketChat/Rocket.Chat.Android.git","svn_url":"https://github.com/RocketChat/Rocket.Chat.Android","homepage":null,"size":1861,"stargazers_count":67,"watchers_count":67,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":26,"forks":43,"open_issues":26,"watchers":67,"default_branch":"develop"}},"base":{"label":"RocketChat:develop","ref":"develop","sha":"d278e218df9eb05568611bb788015f453e343bf6","user":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"repo":{"id":48179404,"name":"Rocket.Chat.Android","full_name":"RocketChat/Rocket.Chat.Android","owner":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RocketChat/Rocket.Chat.Android","description":null,"fork":false,"url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android","forks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/forks","keys_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/teams","hooks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/hooks","issue_events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/events{/number}","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/events","assignees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/assignees{/user}","branches_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/branches{/branch}","tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/tags","blobs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/statuses/{sha}","languages_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/languages","stargazers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/stargazers","contributors_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/contributors","subscribers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/subscribers","subscription_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/subscription","commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/contents/{+path}","compare_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/merges","archive_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/downloads","issues_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues{/number}","pulls_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls{/number}","milestones_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/milestones{/number}","notifications_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/labels{/name}","releases_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/releases{/id}","deployments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/deployments","created_at":"2015-12-17T14:36:45Z","updated_at":"2017-01-23T01:45:57Z","pushed_at":"2017-01-25T12:59:40Z","git_url":"git://github.com/RocketChat/Rocket.Chat.Android.git","ssh_url":"git@github.com:RocketChat/Rocket.Chat.Android.git","clone_url":"https://github.com/RocketChat/Rocket.Chat.Android.git","svn_url":"https://github.com/RocketChat/Rocket.Chat.Android","homepage":null,"size":1861,"stargazers_count":67,"watchers_count":67,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":26,"forks":43,"open_issues":26,"watchers":67,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat.Android/pull/170"},"issue":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/170"},"comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat.Android/statuses/e0440062af3e84dc0fa2e44612f9b36632993d13"}}}}
{"actor":{"display_login":"laggedHero"}}