{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/comments/22752064","id":22752064,"diff_hunk":"@@ -0,0 +1,65 @@\n+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.\r\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n+\r\n+#include \"stdafx.h\"\r\n+#include \"callback_manager.h\"\r\n+\r\n+namespace signalr\r\n+{\r\n+    callback_manager::callback_manager(const web::json::value& dtor_clear_arguments)\r\n+        : m_dtor_clear_arguments(dtor_clear_arguments)\r\n+    { }\r\n+\r\n+    callback_manager::~callback_manager()\r\n+    {\r\n+        clear(m_dtor_clear_arguments);\r\n+    }\r\n+\r\n+    int callback_manager::register_callback(const std::function<void(const web::json::value&)>& callback)\r\n+    {\r\n+        auto callback_id = m_id++;\r\n+\r\n+        {\r\n+            std::lock_guard<std::mutex> lock(m_map_lock);\r\n+\r\n+            m_callbacks.insert(std::make_pair(callback_id, callback));\r\n+        }\r\n+\r\n+        return callback_id;\r\n+    }\r\n+\r\n+    bool callback_manager::complete_callback(int callback_id, const web::json::value& arguments)\r","path":"src/signalrclient/callback_manager.cpp","position":31,"original_position":31,"commit_id":"47674d375459e991c10d5171ef1f9ce7bbff5fb3","original_commit_id":"47674d375459e991c10d5171ef1f9ce7bbff5fb3","user":{"login":"jordanrudd","id":10248121,"avatar_url":"https://avatars.githubusercontent.com/u/10248121?v=3","gravatar_id":"","url":"https://api.github.com/users/jordanrudd","html_url":"https://github.com/jordanrudd","followers_url":"https://api.github.com/users/jordanrudd/followers","following_url":"https://api.github.com/users/jordanrudd/following{/other_user}","gists_url":"https://api.github.com/users/jordanrudd/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanrudd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanrudd/subscriptions","organizations_url":"https://api.github.com/users/jordanrudd/orgs","repos_url":"https://api.github.com/users/jordanrudd/repos","events_url":"https://api.github.com/users/jordanrudd/events{/privacy}","received_events_url":"https://api.github.com/users/jordanrudd/received_events","type":"User","site_admin":false},"body":"Ok, I think I misunderstood the purpose of the callback manager then. I assumed it was holding onto the callbacks that would be registered for each hub method for the lifetime of the connection, in which case they would get invoked several times.","created_at":"2015-01-09T23:59:41Z","updated_at":"2015-01-09T23:59:41Z","html_url":"https://github.com/aspnet/SignalR-Client-Cpp/pull/74#discussion_r22752064","pull_request_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/comments/22752064"},"html":{"href":"https://github.com/aspnet/SignalR-Client-Cpp/pull/74#discussion_r22752064"},"pull_request":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74","id":27136261,"html_url":"https://github.com/aspnet/SignalR-Client-Cpp/pull/74","diff_url":"https://github.com/aspnet/SignalR-Client-Cpp/pull/74.diff","patch_url":"https://github.com/aspnet/SignalR-Client-Cpp/pull/74.patch","issue_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/74","number":74,"state":"open","locked":false,"title":"MayISpeakWithYourManager - introducing callback_manager","user":{"login":"moozzyk","id":1438884,"avatar_url":"https://avatars.githubusercontent.com/u/1438884?v=3","gravatar_id":"","url":"https://api.github.com/users/moozzyk","html_url":"https://github.com/moozzyk","followers_url":"https://api.github.com/users/moozzyk/followers","following_url":"https://api.github.com/users/moozzyk/following{/other_user}","gists_url":"https://api.github.com/users/moozzyk/gists{/gist_id}","starred_url":"https://api.github.com/users/moozzyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moozzyk/subscriptions","organizations_url":"https://api.github.com/users/moozzyk/orgs","repos_url":"https://api.github.com/users/moozzyk/repos","events_url":"https://api.github.com/users/moozzyk/events{/privacy}","received_events_url":"https://api.github.com/users/moozzyk/received_events","type":"User","site_admin":false},"body":"Introducing callback_manager which keeps track of callbacks for incomplete invocations.","created_at":"2015-01-09T23:02:07Z","updated_at":"2015-01-09T23:59:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7e43679f840c084d1029b28bb4f647dcfcc30ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74/commits","review_comments_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74/comments","review_comment_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/comments/{number}","comments_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/74/comments","statuses_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/statuses/47674d375459e991c10d5171ef1f9ce7bbff5fb3","head":{"label":"aspnet:callback_manager","ref":"callback_manager","sha":"47674d375459e991c10d5171ef1f9ce7bbff5fb3","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":24436973,"name":"SignalR-Client-Cpp","full_name":"aspnet/SignalR-Client-Cpp","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/SignalR-Client-Cpp","description":"C++ client for SignalR.","fork":false,"url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp","forks_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/forks","keys_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/teams","hooks_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/hooks","issue_events_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/events","assignees_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/tags","blobs_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/languages","stargazers_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/stargazers","contributors_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/contributors","subscribers_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/subscribers","subscription_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/subscription","commits_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/comments/{number}","contents_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/merges","archive_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/downloads","issues_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/releases{/id}","created_at":"2014-09-25T00:02:40Z","updated_at":"2015-01-09T06:04:16Z","pushed_at":"2015-01-09T23:01:27Z","git_url":"git://github.com/aspnet/SignalR-Client-Cpp.git","ssh_url":"git@github.com:aspnet/SignalR-Client-Cpp.git","clone_url":"https://github.com/aspnet/SignalR-Client-Cpp.git","svn_url":"https://github.com/aspnet/SignalR-Client-Cpp","homepage":"","size":2446,"stargazers_count":18,"watchers_count":18,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":7,"forks":6,"open_issues":7,"watchers":18,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"e236ac79c8007793d58f06ca4dd9ae4c0cc1a7f7","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":24436973,"name":"SignalR-Client-Cpp","full_name":"aspnet/SignalR-Client-Cpp","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/SignalR-Client-Cpp","description":"C++ client for SignalR.","fork":false,"url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp","forks_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/forks","keys_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/teams","hooks_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/hooks","issue_events_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/events","assignees_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/tags","blobs_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/languages","stargazers_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/stargazers","contributors_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/contributors","subscribers_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/subscribers","subscription_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/subscription","commits_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/comments/{number}","contents_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/merges","archive_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/downloads","issues_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/releases{/id}","created_at":"2014-09-25T00:02:40Z","updated_at":"2015-01-09T06:04:16Z","pushed_at":"2015-01-09T23:01:27Z","git_url":"git://github.com/aspnet/SignalR-Client-Cpp.git","ssh_url":"git@github.com:aspnet/SignalR-Client-Cpp.git","clone_url":"https://github.com/aspnet/SignalR-Client-Cpp.git","svn_url":"https://github.com/aspnet/SignalR-Client-Cpp","homepage":"","size":2446,"stargazers_count":18,"watchers_count":18,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":7,"forks":6,"open_issues":7,"watchers":18,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74"},"html":{"href":"https://github.com/aspnet/SignalR-Client-Cpp/pull/74"},"issue":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/74"},"comments":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/SignalR-Client-Cpp/statuses/47674d375459e991c10d5171ef1f9ce7bbff5fb3"}}}}