{"action":"created","comment":{"url":"https://api.github.com/repos/uber/ringpop-go/pulls/comments/45975749","id":45975749,"diff_hunk":"@@ -324,3 +324,17 @@ func (m *memberlist) String() string {\n func (m *memberlist) Iter() *memberlistIter {\n \treturn newMemberlistIter(m)\n }\n+\n+func (m *memberlist) GetActiveMemberAddresses() []string {\n+\tvar active []string\n+\n+\tm.members.RLock()","path":"swim/memberlist.go","position":8,"original_position":8,"commit_id":"c8038d98096f44a6348d63bc285f938f04d3d644","original_commit_id":"c8038d98096f44a6348d63bc285f938f04d3d644","user":{"login":"thanodnl","id":273145,"avatar_url":"https://avatars.githubusercontent.com/u/273145?v=3","gravatar_id":"","url":"https://api.github.com/users/thanodnl","html_url":"https://github.com/thanodnl","followers_url":"https://api.github.com/users/thanodnl/followers","following_url":"https://api.github.com/users/thanodnl/following{/other_user}","gists_url":"https://api.github.com/users/thanodnl/gists{/gist_id}","starred_url":"https://api.github.com/users/thanodnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanodnl/subscriptions","organizations_url":"https://api.github.com/users/thanodnl/orgs","repos_url":"https://api.github.com/users/thanodnl/repos","events_url":"https://api.github.com/users/thanodnl/events{/privacy}","received_events_url":"https://api.github.com/users/thanodnl/received_events","type":"User","site_admin":false},"body":"I chose this over copying the list because a copy operation allocates new memory which we don't need. I don't know what the time difference between a copy and the iteration is. But now I run over the list once and only append the members I need to the new list. I'm also fine with copying the list and iterate over a copy.\r\n\r\nFirst I used the accessors to the memberlist, but every operation tries to acquire the lock for its self. Here I just lock the list once, iterate over it and release the lock.","created_at":"2015-11-26T12:59:22Z","updated_at":"2015-11-26T12:59:22Z","html_url":"https://github.com/uber/ringpop-go/pull/29#discussion_r45975749","pull_request_url":"https://api.github.com/repos/uber/ringpop-go/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/comments/45975749"},"html":{"href":"https://github.com/uber/ringpop-go/pull/29#discussion_r45975749"},"pull_request":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/uber/ringpop-go/pulls/29","id":51172560,"html_url":"https://github.com/uber/ringpop-go/pull/29","diff_url":"https://github.com/uber/ringpop-go/pull/29.diff","patch_url":"https://github.com/uber/ringpop-go/pull/29.patch","issue_url":"https://api.github.com/repos/uber/ringpop-go/issues/29","number":29,"state":"open","locked":false,"title":"Expose a function on ringpop with all the current active members.","user":{"login":"thanodnl","id":273145,"avatar_url":"https://avatars.githubusercontent.com/u/273145?v=3","gravatar_id":"","url":"https://api.github.com/users/thanodnl","html_url":"https://github.com/thanodnl","followers_url":"https://api.github.com/users/thanodnl/followers","following_url":"https://api.github.com/users/thanodnl/following{/other_user}","gists_url":"https://api.github.com/users/thanodnl/gists{/gist_id}","starred_url":"https://api.github.com/users/thanodnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanodnl/subscriptions","organizations_url":"https://api.github.com/users/thanodnl/orgs","repos_url":"https://api.github.com/users/thanodnl/repos","events_url":"https://api.github.com/users/thanodnl/events{/privacy}","received_events_url":"https://api.github.com/users/thanodnl/received_events","type":"User","site_admin":false},"body":"Users that want to get a list of all their active members should be able to get a slice of all those members.\r\n\r\nA use case for this is if the user wants to do a manual fanout to all running instances.\r\n\r\ncc @uber/ringpop ","created_at":"2015-11-19T02:31:39Z","updated_at":"2015-11-26T12:59:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b9eef2d857a0422328898a41e168cc380513f5d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/ringpop-go/pulls/29/commits","review_comments_url":"https://api.github.com/repos/uber/ringpop-go/pulls/29/comments","review_comment_url":"https://api.github.com/repos/uber/ringpop-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/ringpop-go/issues/29/comments","statuses_url":"https://api.github.com/repos/uber/ringpop-go/statuses/c8038d98096f44a6348d63bc285f938f04d3d644","head":{"label":"uber:feature/get-members","ref":"feature/get-members","sha":"c8038d98096f44a6348d63bc285f938f04d3d644","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":36959143,"name":"ringpop-go","full_name":"uber/ringpop-go","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/ringpop-go","description":"Scalable, fault-tolerant application-layer sharding for Go applications","fork":false,"url":"https://api.github.com/repos/uber/ringpop-go","forks_url":"https://api.github.com/repos/uber/ringpop-go/forks","keys_url":"https://api.github.com/repos/uber/ringpop-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/ringpop-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/ringpop-go/teams","hooks_url":"https://api.github.com/repos/uber/ringpop-go/hooks","issue_events_url":"https://api.github.com/repos/uber/ringpop-go/issues/events{/number}","events_url":"https://api.github.com/repos/uber/ringpop-go/events","assignees_url":"https://api.github.com/repos/uber/ringpop-go/assignees{/user}","branches_url":"https://api.github.com/repos/uber/ringpop-go/branches{/branch}","tags_url":"https://api.github.com/repos/uber/ringpop-go/tags","blobs_url":"https://api.github.com/repos/uber/ringpop-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/ringpop-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/ringpop-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/ringpop-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/ringpop-go/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/ringpop-go/languages","stargazers_url":"https://api.github.com/repos/uber/ringpop-go/stargazers","contributors_url":"https://api.github.com/repos/uber/ringpop-go/contributors","subscribers_url":"https://api.github.com/repos/uber/ringpop-go/subscribers","subscription_url":"https://api.github.com/repos/uber/ringpop-go/subscription","commits_url":"https://api.github.com/repos/uber/ringpop-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/ringpop-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/ringpop-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/ringpop-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/ringpop-go/contents/{+path}","compare_url":"https://api.github.com/repos/uber/ringpop-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/ringpop-go/merges","archive_url":"https://api.github.com/repos/uber/ringpop-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/ringpop-go/downloads","issues_url":"https://api.github.com/repos/uber/ringpop-go/issues{/number}","pulls_url":"https://api.github.com/repos/uber/ringpop-go/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/ringpop-go/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/ringpop-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/ringpop-go/labels{/name}","releases_url":"https://api.github.com/repos/uber/ringpop-go/releases{/id}","created_at":"2015-06-05T22:48:53Z","updated_at":"2015-11-24T14:42:17Z","pushed_at":"2015-11-25T14:38:34Z","git_url":"git://github.com/uber/ringpop-go.git","ssh_url":"git@github.com:uber/ringpop-go.git","clone_url":"https://github.com/uber/ringpop-go.git","svn_url":"https://github.com/uber/ringpop-go","homepage":"http://www.uber.com","size":1711,"stargazers_count":19,"watchers_count":19,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":19,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"597a0bb363815e6053ddce013d12c12d4de17d06","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":36959143,"name":"ringpop-go","full_name":"uber/ringpop-go","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/ringpop-go","description":"Scalable, fault-tolerant application-layer sharding for Go applications","fork":false,"url":"https://api.github.com/repos/uber/ringpop-go","forks_url":"https://api.github.com/repos/uber/ringpop-go/forks","keys_url":"https://api.github.com/repos/uber/ringpop-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/ringpop-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/ringpop-go/teams","hooks_url":"https://api.github.com/repos/uber/ringpop-go/hooks","issue_events_url":"https://api.github.com/repos/uber/ringpop-go/issues/events{/number}","events_url":"https://api.github.com/repos/uber/ringpop-go/events","assignees_url":"https://api.github.com/repos/uber/ringpop-go/assignees{/user}","branches_url":"https://api.github.com/repos/uber/ringpop-go/branches{/branch}","tags_url":"https://api.github.com/repos/uber/ringpop-go/tags","blobs_url":"https://api.github.com/repos/uber/ringpop-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/ringpop-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/ringpop-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/ringpop-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/ringpop-go/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/ringpop-go/languages","stargazers_url":"https://api.github.com/repos/uber/ringpop-go/stargazers","contributors_url":"https://api.github.com/repos/uber/ringpop-go/contributors","subscribers_url":"https://api.github.com/repos/uber/ringpop-go/subscribers","subscription_url":"https://api.github.com/repos/uber/ringpop-go/subscription","commits_url":"https://api.github.com/repos/uber/ringpop-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/ringpop-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/ringpop-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/ringpop-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/ringpop-go/contents/{+path}","compare_url":"https://api.github.com/repos/uber/ringpop-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/ringpop-go/merges","archive_url":"https://api.github.com/repos/uber/ringpop-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/ringpop-go/downloads","issues_url":"https://api.github.com/repos/uber/ringpop-go/issues{/number}","pulls_url":"https://api.github.com/repos/uber/ringpop-go/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/ringpop-go/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/ringpop-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/ringpop-go/labels{/name}","releases_url":"https://api.github.com/repos/uber/ringpop-go/releases{/id}","created_at":"2015-06-05T22:48:53Z","updated_at":"2015-11-24T14:42:17Z","pushed_at":"2015-11-25T14:38:34Z","git_url":"git://github.com/uber/ringpop-go.git","ssh_url":"git@github.com:uber/ringpop-go.git","clone_url":"https://github.com/uber/ringpop-go.git","svn_url":"https://github.com/uber/ringpop-go","homepage":"http://www.uber.com","size":1711,"stargazers_count":19,"watchers_count":19,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/29"},"html":{"href":"https://github.com/uber/ringpop-go/pull/29"},"issue":{"href":"https://api.github.com/repos/uber/ringpop-go/issues/29"},"comments":{"href":"https://api.github.com/repos/uber/ringpop-go/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/uber/ringpop-go/statuses/c8038d98096f44a6348d63bc285f938f04d3d644"}}}}