{"action":"created","comment":{"url":"https://api.github.com/repos/basho/riak_ensemble/pulls/comments/31733563","id":31733563,"diff_hunk":"@@ -369,6 +375,13 @@ handle_call({peer_info, Ensemble, Peer}, From, State) ->\n             {noreply, State}\n     end;\n \n+handle_call({subscribe, Callback}, _, State=#state{subscribers=Subscribers}) ->\n+    %% TODO: Change subscriber API to prevent multiple subscriptions with the same callback.\n+    Subscribers2 = [Callback|Subscribers],\n+    application:set_env(riak_ensemble, subscribers, Subscribers2),","path":"src/riak_ensemble_manager.erl","position":45,"original_position":45,"commit_id":"115241c4a8bd109199f75a08db699b3f3acd5b41","original_commit_id":"115241c4a8bd109199f75a08db699b3f3acd5b41","user":{"login":"hmmr","id":1107079,"avatar_url":"https://avatars.githubusercontent.com/u/1107079?v=3","gravatar_id":"","url":"https://api.github.com/users/hmmr","html_url":"https://github.com/hmmr","followers_url":"https://api.github.com/users/hmmr/followers","following_url":"https://api.github.com/users/hmmr/following{/other_user}","gists_url":"https://api.github.com/users/hmmr/gists{/gist_id}","starred_url":"https://api.github.com/users/hmmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmmr/subscriptions","organizations_url":"https://api.github.com/users/hmmr/orgs","repos_url":"https://api.github.com/users/hmmr/repos","events_url":"https://api.github.com/users/hmmr/events{/privacy}","received_events_url":"https://api.github.com/users/hmmr/received_events","type":"User","site_admin":false},"body":"Passing a fun as an arg to application:set_env/1? Is that safe?","created_at":"2015-06-04T15:43:57Z","updated_at":"2015-06-04T15:43:57Z","html_url":"https://github.com/basho/riak_ensemble/pull/72#discussion_r31733563","pull_request_url":"https://api.github.com/repos/basho/riak_ensemble/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/basho/riak_ensemble/pulls/comments/31733563"},"html":{"href":"https://github.com/basho/riak_ensemble/pull/72#discussion_r31733563"},"pull_request":{"href":"https://api.github.com/repos/basho/riak_ensemble/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/basho/riak_ensemble/pulls/72","id":36545471,"html_url":"https://github.com/basho/riak_ensemble/pull/72","diff_url":"https://github.com/basho/riak_ensemble/pull/72.diff","patch_url":"https://github.com/basho/riak_ensemble/pull/72.patch","issue_url":"https://api.github.com/repos/basho/riak_ensemble/issues/72","number":72,"state":"open","locked":false,"title":"Add riak_ensemble_manager:subscribe and associated code","user":{"login":"nickelization","id":4108538,"avatar_url":"https://avatars.githubusercontent.com/u/4108538?v=3","gravatar_id":"","url":"https://api.github.com/users/nickelization","html_url":"https://github.com/nickelization","followers_url":"https://api.github.com/users/nickelization/followers","following_url":"https://api.github.com/users/nickelization/following{/other_user}","gists_url":"https://api.github.com/users/nickelization/gists{/gist_id}","starred_url":"https://api.github.com/users/nickelization/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickelization/subscriptions","organizations_url":"https://api.github.com/users/nickelization/orgs","repos_url":"https://api.github.com/users/nickelization/repos","events_url":"https://api.github.com/users/nickelization/events{/privacy}","received_events_url":"https://api.github.com/users/nickelization/received_events","type":"User","site_admin":false},"body":"This code allows you to set callbacks for ensemble state changes. It's currently needed for some data platform stuff, but potentially useful other places as well. Credit to Cuyler for writing the code - I'm submitting a PR on his behalf so we can get it into the develop branch.","created_at":"2015-05-29T21:11:54Z","updated_at":"2015-06-04T15:43:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ab01c20f878cda2b868e3f66b9809fe0ec067ca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/basho/riak_ensemble/pulls/72/commits","review_comments_url":"https://api.github.com/repos/basho/riak_ensemble/pulls/72/comments","review_comment_url":"https://api.github.com/repos/basho/riak_ensemble/pulls/comments{/number}","comments_url":"https://api.github.com/repos/basho/riak_ensemble/issues/72/comments","statuses_url":"https://api.github.com/repos/basho/riak_ensemble/statuses/115241c4a8bd109199f75a08db699b3f3acd5b41","head":{"label":"basho:feature/cluster-state-subscribe","ref":"feature/cluster-state-subscribe","sha":"115241c4a8bd109199f75a08db699b3f3acd5b41","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":13738526,"name":"riak_ensemble","full_name":"basho/riak_ensemble","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_ensemble","description":"Multi-Paxos framework in Erlang","fork":false,"url":"https://api.github.com/repos/basho/riak_ensemble","forks_url":"https://api.github.com/repos/basho/riak_ensemble/forks","keys_url":"https://api.github.com/repos/basho/riak_ensemble/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_ensemble/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_ensemble/teams","hooks_url":"https://api.github.com/repos/basho/riak_ensemble/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_ensemble/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_ensemble/events","assignees_url":"https://api.github.com/repos/basho/riak_ensemble/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_ensemble/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_ensemble/tags","blobs_url":"https://api.github.com/repos/basho/riak_ensemble/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_ensemble/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_ensemble/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_ensemble/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_ensemble/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_ensemble/languages","stargazers_url":"https://api.github.com/repos/basho/riak_ensemble/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_ensemble/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_ensemble/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_ensemble/subscription","commits_url":"https://api.github.com/repos/basho/riak_ensemble/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_ensemble/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_ensemble/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_ensemble/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_ensemble/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_ensemble/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_ensemble/merges","archive_url":"https://api.github.com/repos/basho/riak_ensemble/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_ensemble/downloads","issues_url":"https://api.github.com/repos/basho/riak_ensemble/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_ensemble/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_ensemble/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_ensemble/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_ensemble/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_ensemble/releases{/id}","created_at":"2013-10-21T09:49:02Z","updated_at":"2015-06-03T15:48:26Z","pushed_at":"2015-06-01T20:25:12Z","git_url":"git://github.com/basho/riak_ensemble.git","ssh_url":"git@github.com:basho/riak_ensemble.git","clone_url":"https://github.com/basho/riak_ensemble.git","svn_url":"https://github.com/basho/riak_ensemble","homepage":"http://www.youtube.com/watch?v=gXJxbhca5Xg","size":2500,"stargazers_count":75,"watchers_count":75,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":15,"forks":10,"open_issues":15,"watchers":75,"default_branch":"develop"}},"base":{"label":"basho:develop","ref":"develop","sha":"bc09e82b55147dca216a1188900afa980c8d5f25","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":13738526,"name":"riak_ensemble","full_name":"basho/riak_ensemble","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_ensemble","description":"Multi-Paxos framework in Erlang","fork":false,"url":"https://api.github.com/repos/basho/riak_ensemble","forks_url":"https://api.github.com/repos/basho/riak_ensemble/forks","keys_url":"https://api.github.com/repos/basho/riak_ensemble/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_ensemble/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_ensemble/teams","hooks_url":"https://api.github.com/repos/basho/riak_ensemble/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_ensemble/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_ensemble/events","assignees_url":"https://api.github.com/repos/basho/riak_ensemble/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_ensemble/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_ensemble/tags","blobs_url":"https://api.github.com/repos/basho/riak_ensemble/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_ensemble/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_ensemble/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_ensemble/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_ensemble/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_ensemble/languages","stargazers_url":"https://api.github.com/repos/basho/riak_ensemble/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_ensemble/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_ensemble/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_ensemble/subscription","commits_url":"https://api.github.com/repos/basho/riak_ensemble/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_ensemble/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_ensemble/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_ensemble/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_ensemble/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_ensemble/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_ensemble/merges","archive_url":"https://api.github.com/repos/basho/riak_ensemble/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_ensemble/downloads","issues_url":"https://api.github.com/repos/basho/riak_ensemble/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_ensemble/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_ensemble/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_ensemble/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_ensemble/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_ensemble/releases{/id}","created_at":"2013-10-21T09:49:02Z","updated_at":"2015-06-03T15:48:26Z","pushed_at":"2015-06-01T20:25:12Z","git_url":"git://github.com/basho/riak_ensemble.git","ssh_url":"git@github.com:basho/riak_ensemble.git","clone_url":"https://github.com/basho/riak_ensemble.git","svn_url":"https://github.com/basho/riak_ensemble","homepage":"http://www.youtube.com/watch?v=gXJxbhca5Xg","size":2500,"stargazers_count":75,"watchers_count":75,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":15,"forks":10,"open_issues":15,"watchers":75,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/riak_ensemble/pulls/72"},"html":{"href":"https://github.com/basho/riak_ensemble/pull/72"},"issue":{"href":"https://api.github.com/repos/basho/riak_ensemble/issues/72"},"comments":{"href":"https://api.github.com/repos/basho/riak_ensemble/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/riak_ensemble/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/riak_ensemble/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/basho/riak_ensemble/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/basho/riak_ensemble/statuses/115241c4a8bd109199f75a08db699b3f3acd5b41"}}}}