{"action":"created","comment":{"url":"https://api.github.com/repos/istio/mixerclient/pulls/comments/95729381","pull_request_review_id":16293202,"id":95729381,"diff_hunk":"@@ -31,22 +31,58 @@ namespace mixer_client {\n // is completed.\n using DoneFunc = std::function<void(const ::google::protobuf::util::Status&)>;\n \n+// Define transport context status\n+typedef enum {\n+  CTX_OK = 0,\n+  CTX_NOT_EXIST,\n+} CtxStatus;\n+\n+// Transport Context ID type.\n+typedef int CtxID;\n+\n+// A function to create a new transport context\n+using TransportCtxNewFunc = std::function<CtxID()>;\n+// A function to close a transport context\n+using TransportCtxCloseFunc = std::function<void(CtxID)>;\n+\n+// Use context to support transport layer streaming.\n+// Transport will use same stream if ctx_id is the same.\n+// Caller can do delta update with same ctx_id.\n+//\n+// // create a new context\n+// ctx_id = CtxNew();\n+//\n+// while (request : request_list) {\n+//   CtxStatus ret = Check(ctx_id, request, response, on_done);\n+//   if (ret == CTX_NOT_EXIST) {\n+//      // The stream is reset by peer. create a new context\n+//      ctx_id = CtxNew();\n+//      // Re-generate request with new context, and call again\n+//      ret = Check(ctx_id, request, response, on_done);\n+//      // should NOT happen for a newly created context.\n+//      ASSERT(ret != CTX_NOT_EXIST);\n+//   }\n+// }\n+//\n+// // Close the context.\n+// CtxClose(ctx_id);\n+\n // Defines a function prototype to make an asynchronous Check call to\n // the mixer server.\n-using TransportCheckFunc = std::function<void(\n-    const ::istio::mixer::v1::CheckRequest& request,\n+using TransportCheckFunc = std::function<CtxStatus(","path":"include/client.h","position":44,"original_position":44,"commit_id":"7863ef362791a311f2c4f2b9e65ecaf5cf3f167d","original_commit_id":"7863ef362791a311f2c4f2b9e65ecaf5cf3f167d","user":{"login":"lizan","id":1016047,"avatar_url":"https://avatars.githubusercontent.com/u/1016047?v=3","gravatar_id":"","url":"https://api.github.com/users/lizan","html_url":"https://github.com/lizan","followers_url":"https://api.github.com/users/lizan/followers","following_url":"https://api.github.com/users/lizan/following{/other_user}","gists_url":"https://api.github.com/users/lizan/gists{/gist_id}","starred_url":"https://api.github.com/users/lizan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizan/subscriptions","organizations_url":"https://api.github.com/users/lizan/orgs","repos_url":"https://api.github.com/users/lizan/repos","events_url":"https://api.github.com/users/lizan/events{/privacy}","received_events_url":"https://api.github.com/users/lizan/received_events","type":"User","site_admin":false},"body":"Do you expect TransportCheckFunc to pair `request_index` in CheckRequest and CheckResponse? That sounds too much for a transport.","created_at":"2017-01-12T05:52:46Z","updated_at":"2017-01-12T05:57:32Z","html_url":"https://github.com/istio/mixerclient/pull/6#discussion_r95729381","pull_request_url":"https://api.github.com/repos/istio/mixerclient/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/istio/mixerclient/pulls/comments/95729381"},"html":{"href":"https://github.com/istio/mixerclient/pull/6#discussion_r95729381"},"pull_request":{"href":"https://api.github.com/repos/istio/mixerclient/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/istio/mixerclient/pulls/6","id":101187097,"html_url":"https://github.com/istio/mixerclient/pull/6","diff_url":"https://github.com/istio/mixerclient/pull/6.diff","patch_url":"https://github.com/istio/mixerclient/pull/6.patch","issue_url":"https://api.github.com/repos/istio/mixerclient/issues/6","number":6,"state":"open","locked":false,"title":"Update transport API to support streaming.","user":{"login":"qiwzhang","id":11790727,"avatar_url":"https://avatars.githubusercontent.com/u/11790727?v=3","gravatar_id":"","url":"https://api.github.com/users/qiwzhang","html_url":"https://github.com/qiwzhang","followers_url":"https://api.github.com/users/qiwzhang/followers","following_url":"https://api.github.com/users/qiwzhang/following{/other_user}","gists_url":"https://api.github.com/users/qiwzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/qiwzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiwzhang/subscriptions","organizations_url":"https://api.github.com/users/qiwzhang/orgs","repos_url":"https://api.github.com/users/qiwzhang/repos","events_url":"https://api.github.com/users/qiwzhang/events{/privacy}","received_events_url":"https://api.github.com/users/qiwzhang/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-01-12T02:39:52Z","updated_at":"2017-01-12T05:57:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ffc016453aff6ca3e66dd9f9d86ca48967008d59","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/istio/mixerclient/pulls/6/commits","review_comments_url":"https://api.github.com/repos/istio/mixerclient/pulls/6/comments","review_comment_url":"https://api.github.com/repos/istio/mixerclient/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istio/mixerclient/issues/6/comments","statuses_url":"https://api.github.com/repos/istio/mixerclient/statuses/7863ef362791a311f2c4f2b9e65ecaf5cf3f167d","head":{"label":"qiwzhang:streaming_transport","ref":"streaming_transport","sha":"7863ef362791a311f2c4f2b9e65ecaf5cf3f167d","user":{"login":"qiwzhang","id":11790727,"avatar_url":"https://avatars.githubusercontent.com/u/11790727?v=3","gravatar_id":"","url":"https://api.github.com/users/qiwzhang","html_url":"https://github.com/qiwzhang","followers_url":"https://api.github.com/users/qiwzhang/followers","following_url":"https://api.github.com/users/qiwzhang/following{/other_user}","gists_url":"https://api.github.com/users/qiwzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/qiwzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiwzhang/subscriptions","organizations_url":"https://api.github.com/users/qiwzhang/orgs","repos_url":"https://api.github.com/users/qiwzhang/repos","events_url":"https://api.github.com/users/qiwzhang/events{/privacy}","received_events_url":"https://api.github.com/users/qiwzhang/received_events","type":"User","site_admin":false},"repo":{"id":78229323,"name":"mixerclient","full_name":"qiwzhang/mixerclient","owner":{"login":"qiwzhang","id":11790727,"avatar_url":"https://avatars.githubusercontent.com/u/11790727?v=3","gravatar_id":"","url":"https://api.github.com/users/qiwzhang","html_url":"https://github.com/qiwzhang","followers_url":"https://api.github.com/users/qiwzhang/followers","following_url":"https://api.github.com/users/qiwzhang/following{/other_user}","gists_url":"https://api.github.com/users/qiwzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/qiwzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiwzhang/subscriptions","organizations_url":"https://api.github.com/users/qiwzhang/orgs","repos_url":"https://api.github.com/users/qiwzhang/repos","events_url":"https://api.github.com/users/qiwzhang/events{/privacy}","received_events_url":"https://api.github.com/users/qiwzhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qiwzhang/mixerclient","description":"C++ client for the mixer API","fork":true,"url":"https://api.github.com/repos/qiwzhang/mixerclient","forks_url":"https://api.github.com/repos/qiwzhang/mixerclient/forks","keys_url":"https://api.github.com/repos/qiwzhang/mixerclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qiwzhang/mixerclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qiwzhang/mixerclient/teams","hooks_url":"https://api.github.com/repos/qiwzhang/mixerclient/hooks","issue_events_url":"https://api.github.com/repos/qiwzhang/mixerclient/issues/events{/number}","events_url":"https://api.github.com/repos/qiwzhang/mixerclient/events","assignees_url":"https://api.github.com/repos/qiwzhang/mixerclient/assignees{/user}","branches_url":"https://api.github.com/repos/qiwzhang/mixerclient/branches{/branch}","tags_url":"https://api.github.com/repos/qiwzhang/mixerclient/tags","blobs_url":"https://api.github.com/repos/qiwzhang/mixerclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qiwzhang/mixerclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qiwzhang/mixerclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/qiwzhang/mixerclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qiwzhang/mixerclient/statuses/{sha}","languages_url":"https://api.github.com/repos/qiwzhang/mixerclient/languages","stargazers_url":"https://api.github.com/repos/qiwzhang/mixerclient/stargazers","contributors_url":"https://api.github.com/repos/qiwzhang/mixerclient/contributors","subscribers_url":"https://api.github.com/repos/qiwzhang/mixerclient/subscribers","subscription_url":"https://api.github.com/repos/qiwzhang/mixerclient/subscription","commits_url":"https://api.github.com/repos/qiwzhang/mixerclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/qiwzhang/mixerclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/qiwzhang/mixerclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/qiwzhang/mixerclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/qiwzhang/mixerclient/contents/{+path}","compare_url":"https://api.github.com/repos/qiwzhang/mixerclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qiwzhang/mixerclient/merges","archive_url":"https://api.github.com/repos/qiwzhang/mixerclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qiwzhang/mixerclient/downloads","issues_url":"https://api.github.com/repos/qiwzhang/mixerclient/issues{/number}","pulls_url":"https://api.github.com/repos/qiwzhang/mixerclient/pulls{/number}","milestones_url":"https://api.github.com/repos/qiwzhang/mixerclient/milestones{/number}","notifications_url":"https://api.github.com/repos/qiwzhang/mixerclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qiwzhang/mixerclient/labels{/name}","releases_url":"https://api.github.com/repos/qiwzhang/mixerclient/releases{/id}","deployments_url":"https://api.github.com/repos/qiwzhang/mixerclient/deployments","created_at":"2017-01-06T18:34:34Z","updated_at":"2016-12-16T18:24:03Z","pushed_at":"2017-01-12T03:51:11Z","git_url":"git://github.com/qiwzhang/mixerclient.git","ssh_url":"git@github.com:qiwzhang/mixerclient.git","clone_url":"https://github.com/qiwzhang/mixerclient.git","svn_url":"https://github.com/qiwzhang/mixerclient","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"istio:master","ref":"master","sha":"b63f00003db51909e9f844edf4e0d883bbf4829f","user":{"login":"istio","id":23534644,"avatar_url":"https://avatars.githubusercontent.com/u/23534644?v=3","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"repo":{"id":76675987,"name":"mixerclient","full_name":"istio/mixerclient","owner":{"login":"istio","id":23534644,"avatar_url":"https://avatars.githubusercontent.com/u/23534644?v=3","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/istio/mixerclient","description":"C++ client for the mixer API","fork":false,"url":"https://api.github.com/repos/istio/mixerclient","forks_url":"https://api.github.com/repos/istio/mixerclient/forks","keys_url":"https://api.github.com/repos/istio/mixerclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istio/mixerclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istio/mixerclient/teams","hooks_url":"https://api.github.com/repos/istio/mixerclient/hooks","issue_events_url":"https://api.github.com/repos/istio/mixerclient/issues/events{/number}","events_url":"https://api.github.com/repos/istio/mixerclient/events","assignees_url":"https://api.github.com/repos/istio/mixerclient/assignees{/user}","branches_url":"https://api.github.com/repos/istio/mixerclient/branches{/branch}","tags_url":"https://api.github.com/repos/istio/mixerclient/tags","blobs_url":"https://api.github.com/repos/istio/mixerclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istio/mixerclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istio/mixerclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/istio/mixerclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istio/mixerclient/statuses/{sha}","languages_url":"https://api.github.com/repos/istio/mixerclient/languages","stargazers_url":"https://api.github.com/repos/istio/mixerclient/stargazers","contributors_url":"https://api.github.com/repos/istio/mixerclient/contributors","subscribers_url":"https://api.github.com/repos/istio/mixerclient/subscribers","subscription_url":"https://api.github.com/repos/istio/mixerclient/subscription","commits_url":"https://api.github.com/repos/istio/mixerclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/istio/mixerclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/istio/mixerclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/istio/mixerclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/istio/mixerclient/contents/{+path}","compare_url":"https://api.github.com/repos/istio/mixerclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istio/mixerclient/merges","archive_url":"https://api.github.com/repos/istio/mixerclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istio/mixerclient/downloads","issues_url":"https://api.github.com/repos/istio/mixerclient/issues{/number}","pulls_url":"https://api.github.com/repos/istio/mixerclient/pulls{/number}","milestones_url":"https://api.github.com/repos/istio/mixerclient/milestones{/number}","notifications_url":"https://api.github.com/repos/istio/mixerclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istio/mixerclient/labels{/name}","releases_url":"https://api.github.com/repos/istio/mixerclient/releases{/id}","deployments_url":"https://api.github.com/repos/istio/mixerclient/deployments","created_at":"2016-12-16T18:24:03Z","updated_at":"2017-01-09T18:36:26Z","pushed_at":"2017-01-12T03:51:11Z","git_url":"git://github.com/istio/mixerclient.git","ssh_url":"git@github.com:istio/mixerclient.git","clone_url":"https://github.com/istio/mixerclient.git","svn_url":"https://github.com/istio/mixerclient","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istio/mixerclient/pulls/6"},"html":{"href":"https://github.com/istio/mixerclient/pull/6"},"issue":{"href":"https://api.github.com/repos/istio/mixerclient/issues/6"},"comments":{"href":"https://api.github.com/repos/istio/mixerclient/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/istio/mixerclient/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/istio/mixerclient/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istio/mixerclient/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/istio/mixerclient/statuses/7863ef362791a311f2c4f2b9e65ecaf5cf3f167d"}}}}
{"actor":{"display_login":"lizan"}}