{"action":"created","comment":{"url":"https://api.github.com/repos/etaty/rediscala/pulls/comments/47149508","id":47149508,"diff_hunk":"@@ -138,6 +178,23 @@ abstract class SentinelMonitored(system: ActorSystem) {\n \n     Await.result(ff, 15 seconds)\n   }\n+\n+  def withSlavesAddr[T](initFunction: Seq[(String, Int)] => T): T = {\n+     import scala.concurrent.duration._\n+\n+    val fslaves = Future.sequence(sentinelClients.values.map(_.slaves(master)))\n+      .map { lm =>\n+        val ipAndPort = lm.flatten.flatMap { m =>\n+          (m.get(\"ip\"), m.get(\"port\")) match {\n+            case (Some(ip), Some(port)) => Some((ip, port.toInt))\n+            case _ => None\n+          }\n+        }.toSeq.distinct\n+        initFunction(ipAndPort)\n+      }\n+    Await.result(fslaves, 15 seconds)","path":"src/main/scala/redis/Sentinel.scala","position":132,"original_position":132,"commit_id":"762ecadc6113c7d4792b50ba42ee36bcda3b15cb","original_commit_id":"762ecadc6113c7d4792b50ba42ee36bcda3b15cb","user":{"login":"etaty","id":461170,"avatar_url":"https://avatars.githubusercontent.com/u/461170?v=3","gravatar_id":"","url":"https://api.github.com/users/etaty","html_url":"https://github.com/etaty","followers_url":"https://api.github.com/users/etaty/followers","following_url":"https://api.github.com/users/etaty/following{/other_user}","gists_url":"https://api.github.com/users/etaty/gists{/gist_id}","starred_url":"https://api.github.com/users/etaty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etaty/subscriptions","organizations_url":"https://api.github.com/users/etaty/orgs","repos_url":"https://api.github.com/users/etaty/repos","events_url":"https://api.github.com/users/etaty/events{/privacy}","received_events_url":"https://api.github.com/users/etaty/received_events","type":"User","site_admin":false},"body":"Hum I don't like the Await (blocking)\r\nI would prefer this function : \r\n`def slaves():Future[(String,Int)]`\r\n\r\nI will try to refactor `withMasterAddr` so there is no Await #108","created_at":"2015-12-09T20:48:59Z","updated_at":"2015-12-09T20:48:59Z","html_url":"https://github.com/etaty/rediscala/pull/103#discussion_r47149508","pull_request_url":"https://api.github.com/repos/etaty/rediscala/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/etaty/rediscala/pulls/comments/47149508"},"html":{"href":"https://github.com/etaty/rediscala/pull/103#discussion_r47149508"},"pull_request":{"href":"https://api.github.com/repos/etaty/rediscala/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/etaty/rediscala/pulls/103","id":52741280,"html_url":"https://github.com/etaty/rediscala/pull/103","diff_url":"https://github.com/etaty/rediscala/pull/103.diff","patch_url":"https://github.com/etaty/rediscala/pull/103.patch","issue_url":"https://api.github.com/repos/etaty/rediscala/issues/103","number":103,"state":"open","locked":false,"title":"Sentinel pool slave","user":{"login":"npeters","id":935249,"avatar_url":"https://avatars.githubusercontent.com/u/935249?v=3","gravatar_id":"","url":"https://api.github.com/users/npeters","html_url":"https://github.com/npeters","followers_url":"https://api.github.com/users/npeters/followers","following_url":"https://api.github.com/users/npeters/following{/other_user}","gists_url":"https://api.github.com/users/npeters/gists{/gist_id}","starred_url":"https://api.github.com/users/npeters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npeters/subscriptions","organizations_url":"https://api.github.com/users/npeters/orgs","repos_url":"https://api.github.com/users/npeters/repos","events_url":"https://api.github.com/users/npeters/events{/privacy}","received_events_url":"https://api.github.com/users/npeters/received_events","type":"User","site_admin":false},"body":"sentinel  manage a slave pool: \r\n- connect/disconnect\r\n- load balancing   ","created_at":"2015-12-05T01:06:45Z","updated_at":"2015-12-09T20:48:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e80b110d91c8eb639da772f1d2ff7ef621bc98ca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/etaty/rediscala/pulls/103/commits","review_comments_url":"https://api.github.com/repos/etaty/rediscala/pulls/103/comments","review_comment_url":"https://api.github.com/repos/etaty/rediscala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/etaty/rediscala/issues/103/comments","statuses_url":"https://api.github.com/repos/etaty/rediscala/statuses/762ecadc6113c7d4792b50ba42ee36bcda3b15cb","head":{"label":"npeters:sentinel-pool-slave","ref":"sentinel-pool-slave","sha":"762ecadc6113c7d4792b50ba42ee36bcda3b15cb","user":{"login":"npeters","id":935249,"avatar_url":"https://avatars.githubusercontent.com/u/935249?v=3","gravatar_id":"","url":"https://api.github.com/users/npeters","html_url":"https://github.com/npeters","followers_url":"https://api.github.com/users/npeters/followers","following_url":"https://api.github.com/users/npeters/following{/other_user}","gists_url":"https://api.github.com/users/npeters/gists{/gist_id}","starred_url":"https://api.github.com/users/npeters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npeters/subscriptions","organizations_url":"https://api.github.com/users/npeters/orgs","repos_url":"https://api.github.com/users/npeters/repos","events_url":"https://api.github.com/users/npeters/events{/privacy}","received_events_url":"https://api.github.com/users/npeters/received_events","type":"User","site_admin":false},"repo":{"id":22972768,"name":"rediscala","full_name":"npeters/rediscala","owner":{"login":"npeters","id":935249,"avatar_url":"https://avatars.githubusercontent.com/u/935249?v=3","gravatar_id":"","url":"https://api.github.com/users/npeters","html_url":"https://github.com/npeters","followers_url":"https://api.github.com/users/npeters/followers","following_url":"https://api.github.com/users/npeters/following{/other_user}","gists_url":"https://api.github.com/users/npeters/gists{/gist_id}","starred_url":"https://api.github.com/users/npeters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npeters/subscriptions","organizations_url":"https://api.github.com/users/npeters/orgs","repos_url":"https://api.github.com/users/npeters/repos","events_url":"https://api.github.com/users/npeters/events{/privacy}","received_events_url":"https://api.github.com/users/npeters/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/npeters/rediscala","description":"Non-blocking, Reactive Redis driver for Scala (with Sentinel support)","fork":true,"url":"https://api.github.com/repos/npeters/rediscala","forks_url":"https://api.github.com/repos/npeters/rediscala/forks","keys_url":"https://api.github.com/repos/npeters/rediscala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npeters/rediscala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npeters/rediscala/teams","hooks_url":"https://api.github.com/repos/npeters/rediscala/hooks","issue_events_url":"https://api.github.com/repos/npeters/rediscala/issues/events{/number}","events_url":"https://api.github.com/repos/npeters/rediscala/events","assignees_url":"https://api.github.com/repos/npeters/rediscala/assignees{/user}","branches_url":"https://api.github.com/repos/npeters/rediscala/branches{/branch}","tags_url":"https://api.github.com/repos/npeters/rediscala/tags","blobs_url":"https://api.github.com/repos/npeters/rediscala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npeters/rediscala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npeters/rediscala/git/refs{/sha}","trees_url":"https://api.github.com/repos/npeters/rediscala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npeters/rediscala/statuses/{sha}","languages_url":"https://api.github.com/repos/npeters/rediscala/languages","stargazers_url":"https://api.github.com/repos/npeters/rediscala/stargazers","contributors_url":"https://api.github.com/repos/npeters/rediscala/contributors","subscribers_url":"https://api.github.com/repos/npeters/rediscala/subscribers","subscription_url":"https://api.github.com/repos/npeters/rediscala/subscription","commits_url":"https://api.github.com/repos/npeters/rediscala/commits{/sha}","git_commits_url":"https://api.github.com/repos/npeters/rediscala/git/commits{/sha}","comments_url":"https://api.github.com/repos/npeters/rediscala/comments{/number}","issue_comment_url":"https://api.github.com/repos/npeters/rediscala/issues/comments{/number}","contents_url":"https://api.github.com/repos/npeters/rediscala/contents/{+path}","compare_url":"https://api.github.com/repos/npeters/rediscala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npeters/rediscala/merges","archive_url":"https://api.github.com/repos/npeters/rediscala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npeters/rediscala/downloads","issues_url":"https://api.github.com/repos/npeters/rediscala/issues{/number}","pulls_url":"https://api.github.com/repos/npeters/rediscala/pulls{/number}","milestones_url":"https://api.github.com/repos/npeters/rediscala/milestones{/number}","notifications_url":"https://api.github.com/repos/npeters/rediscala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npeters/rediscala/labels{/name}","releases_url":"https://api.github.com/repos/npeters/rediscala/releases{/id}","created_at":"2014-08-15T00:14:56Z","updated_at":"2015-06-30T11:55:24Z","pushed_at":"2015-12-09T01:55:20Z","git_url":"git://github.com/npeters/rediscala.git","ssh_url":"git@github.com:npeters/rediscala.git","clone_url":"https://github.com/npeters/rediscala.git","svn_url":"https://github.com/npeters/rediscala","homepage":"","size":3240,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"etaty:master","ref":"master","sha":"02793628d4e1bfde2663fd8038a0866489c9b741","user":{"login":"etaty","id":461170,"avatar_url":"https://avatars.githubusercontent.com/u/461170?v=3","gravatar_id":"","url":"https://api.github.com/users/etaty","html_url":"https://github.com/etaty","followers_url":"https://api.github.com/users/etaty/followers","following_url":"https://api.github.com/users/etaty/following{/other_user}","gists_url":"https://api.github.com/users/etaty/gists{/gist_id}","starred_url":"https://api.github.com/users/etaty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etaty/subscriptions","organizations_url":"https://api.github.com/users/etaty/orgs","repos_url":"https://api.github.com/users/etaty/repos","events_url":"https://api.github.com/users/etaty/events{/privacy}","received_events_url":"https://api.github.com/users/etaty/received_events","type":"User","site_admin":false},"repo":{"id":9449740,"name":"rediscala","full_name":"etaty/rediscala","owner":{"login":"etaty","id":461170,"avatar_url":"https://avatars.githubusercontent.com/u/461170?v=3","gravatar_id":"","url":"https://api.github.com/users/etaty","html_url":"https://github.com/etaty","followers_url":"https://api.github.com/users/etaty/followers","following_url":"https://api.github.com/users/etaty/following{/other_user}","gists_url":"https://api.github.com/users/etaty/gists{/gist_id}","starred_url":"https://api.github.com/users/etaty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etaty/subscriptions","organizations_url":"https://api.github.com/users/etaty/orgs","repos_url":"https://api.github.com/users/etaty/repos","events_url":"https://api.github.com/users/etaty/events{/privacy}","received_events_url":"https://api.github.com/users/etaty/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/etaty/rediscala","description":"Non-blocking, Reactive Redis driver for Scala (with Sentinel support)","fork":false,"url":"https://api.github.com/repos/etaty/rediscala","forks_url":"https://api.github.com/repos/etaty/rediscala/forks","keys_url":"https://api.github.com/repos/etaty/rediscala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/etaty/rediscala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/etaty/rediscala/teams","hooks_url":"https://api.github.com/repos/etaty/rediscala/hooks","issue_events_url":"https://api.github.com/repos/etaty/rediscala/issues/events{/number}","events_url":"https://api.github.com/repos/etaty/rediscala/events","assignees_url":"https://api.github.com/repos/etaty/rediscala/assignees{/user}","branches_url":"https://api.github.com/repos/etaty/rediscala/branches{/branch}","tags_url":"https://api.github.com/repos/etaty/rediscala/tags","blobs_url":"https://api.github.com/repos/etaty/rediscala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/etaty/rediscala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/etaty/rediscala/git/refs{/sha}","trees_url":"https://api.github.com/repos/etaty/rediscala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/etaty/rediscala/statuses/{sha}","languages_url":"https://api.github.com/repos/etaty/rediscala/languages","stargazers_url":"https://api.github.com/repos/etaty/rediscala/stargazers","contributors_url":"https://api.github.com/repos/etaty/rediscala/contributors","subscribers_url":"https://api.github.com/repos/etaty/rediscala/subscribers","subscription_url":"https://api.github.com/repos/etaty/rediscala/subscription","commits_url":"https://api.github.com/repos/etaty/rediscala/commits{/sha}","git_commits_url":"https://api.github.com/repos/etaty/rediscala/git/commits{/sha}","comments_url":"https://api.github.com/repos/etaty/rediscala/comments{/number}","issue_comment_url":"https://api.github.com/repos/etaty/rediscala/issues/comments{/number}","contents_url":"https://api.github.com/repos/etaty/rediscala/contents/{+path}","compare_url":"https://api.github.com/repos/etaty/rediscala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/etaty/rediscala/merges","archive_url":"https://api.github.com/repos/etaty/rediscala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/etaty/rediscala/downloads","issues_url":"https://api.github.com/repos/etaty/rediscala/issues{/number}","pulls_url":"https://api.github.com/repos/etaty/rediscala/pulls{/number}","milestones_url":"https://api.github.com/repos/etaty/rediscala/milestones{/number}","notifications_url":"https://api.github.com/repos/etaty/rediscala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/etaty/rediscala/labels{/name}","releases_url":"https://api.github.com/repos/etaty/rediscala/releases{/id}","created_at":"2013-04-15T13:49:16Z","updated_at":"2015-12-08T17:48:34Z","pushed_at":"2015-12-09T01:55:22Z","git_url":"git://github.com/etaty/rediscala.git","ssh_url":"git@github.com:etaty/rediscala.git","clone_url":"https://github.com/etaty/rediscala.git","svn_url":"https://github.com/etaty/rediscala","homepage":"","size":4017,"stargazers_count":471,"watchers_count":471,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":63,"mirror_url":null,"open_issues_count":18,"forks":63,"open_issues":18,"watchers":471,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/etaty/rediscala/pulls/103"},"html":{"href":"https://github.com/etaty/rediscala/pull/103"},"issue":{"href":"https://api.github.com/repos/etaty/rediscala/issues/103"},"comments":{"href":"https://api.github.com/repos/etaty/rediscala/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/etaty/rediscala/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/etaty/rediscala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/etaty/rediscala/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/etaty/rediscala/statuses/762ecadc6113c7d4792b50ba42ee36bcda3b15cb"}}}}