{"action":"created","comment":{"url":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/comments/137386347","pull_request_review_id":61046962,"id":137386347,"diff_hunk":"@@ -116,13 +117,24 @@ folly::Future<folly::Unit> RSocketClient::resume() {\n   });\n }\n \n-void RSocketClient::disconnect(folly::exception_wrapper ex) {\n-  CHECK(stateMachine_);\n-  evb_->runInEventBaseThread(\n-      [ stateMachine = stateMachine_, ex = std::move(ex) ]() mutable {\n-        VLOG(2) << \"Disconnecting RSocketStateMachine on EventBase\";\n-        stateMachine->disconnect(std::move(ex));\n-      });\n+folly::Future<folly::Unit> RSocketClient::disconnect(\n+    folly::exception_wrapper ew) {\n+  if (!stateMachine_) {","path":"rsocket/RSocketClient.cpp","position":null,"original_position":21,"commit_id":"98f634eed3907a72aab05d21479d111545865fe0","original_commit_id":"1ce2cc38b896c5ffef7cace2f7dfabc769a3a66f","user":{"login":"alexmalyshev","id":621989,"avatar_url":"https://avatars3.githubusercontent.com/u/621989?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmalyshev","html_url":"https://github.com/alexmalyshev","followers_url":"https://api.github.com/users/alexmalyshev/followers","following_url":"https://api.github.com/users/alexmalyshev/following{/other_user}","gists_url":"https://api.github.com/users/alexmalyshev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmalyshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmalyshev/subscriptions","organizations_url":"https://api.github.com/users/alexmalyshev/orgs","repos_url":"https://api.github.com/users/alexmalyshev/repos","events_url":"https://api.github.com/users/alexmalyshev/events{/privacy}","received_events_url":"https://api.github.com/users/alexmalyshev/received_events","type":"User","site_admin":false},"body":"@dymk I made it a `DCHECK`, as this is kind of an invariant violation on our part.  I guess I could make it return an exception just in case, think it's worth it?","created_at":"2017-09-06T20:50:41Z","updated_at":"2017-09-06T20:50:41Z","html_url":"https://github.com/rsocket/rsocket-cpp/pull/726#discussion_r137386347","pull_request_url":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/comments/137386347"},"html":{"href":"https://github.com/rsocket/rsocket-cpp/pull/726#discussion_r137386347"},"pull_request":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726"}},"in_reply_to_id":137383399},"pull_request":{"url":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726","id":139655913,"html_url":"https://github.com/rsocket/rsocket-cpp/pull/726","diff_url":"https://github.com/rsocket/rsocket-cpp/pull/726.diff","patch_url":"https://github.com/rsocket/rsocket-cpp/pull/726.patch","issue_url":"https://api.github.com/repos/rsocket/rsocket-cpp/issues/726","number":726,"state":"open","locked":false,"title":"RSocketClient::disconnect() should return a future","user":{"login":"alexmalyshev","id":621989,"avatar_url":"https://avatars3.githubusercontent.com/u/621989?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmalyshev","html_url":"https://github.com/alexmalyshev","followers_url":"https://api.github.com/users/alexmalyshev/followers","following_url":"https://api.github.com/users/alexmalyshev/following{/other_user}","gists_url":"https://api.github.com/users/alexmalyshev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmalyshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmalyshev/subscriptions","organizations_url":"https://api.github.com/users/alexmalyshev/orgs","repos_url":"https://api.github.com/users/alexmalyshev/repos","events_url":"https://api.github.com/users/alexmalyshev/events{/privacy}","received_events_url":"https://api.github.com/users/alexmalyshev/received_events","type":"User","site_admin":false},"body":"Right now it does the disconnect asynchronously, with no good way to force it to\r\nbe synchronous.  Similarly, ~RSocketClient didn't call disconnect(), so it seems\r\nlike it would destroy the state machine on a different thread than the\r\nConnectionFactory worker thread.","created_at":"2017-09-06T20:22:33Z","updated_at":"2017-09-06T20:50:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a4de244a71083fd4673422f9722f5d6d03f3415","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726/commits","review_comments_url":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726/comments","review_comment_url":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rsocket/rsocket-cpp/issues/726/comments","statuses_url":"https://api.github.com/repos/rsocket/rsocket-cpp/statuses/98f634eed3907a72aab05d21479d111545865fe0","head":{"label":"alexmalyshev:client-disconnect","ref":"client-disconnect","sha":"98f634eed3907a72aab05d21479d111545865fe0","user":{"login":"alexmalyshev","id":621989,"avatar_url":"https://avatars3.githubusercontent.com/u/621989?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmalyshev","html_url":"https://github.com/alexmalyshev","followers_url":"https://api.github.com/users/alexmalyshev/followers","following_url":"https://api.github.com/users/alexmalyshev/following{/other_user}","gists_url":"https://api.github.com/users/alexmalyshev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmalyshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmalyshev/subscriptions","organizations_url":"https://api.github.com/users/alexmalyshev/orgs","repos_url":"https://api.github.com/users/alexmalyshev/repos","events_url":"https://api.github.com/users/alexmalyshev/events{/privacy}","received_events_url":"https://api.github.com/users/alexmalyshev/received_events","type":"User","site_admin":false},"repo":{"id":89657715,"name":"rsocket-cpp","full_name":"alexmalyshev/rsocket-cpp","owner":{"login":"alexmalyshev","id":621989,"avatar_url":"https://avatars3.githubusercontent.com/u/621989?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmalyshev","html_url":"https://github.com/alexmalyshev","followers_url":"https://api.github.com/users/alexmalyshev/followers","following_url":"https://api.github.com/users/alexmalyshev/following{/other_user}","gists_url":"https://api.github.com/users/alexmalyshev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmalyshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmalyshev/subscriptions","organizations_url":"https://api.github.com/users/alexmalyshev/orgs","repos_url":"https://api.github.com/users/alexmalyshev/repos","events_url":"https://api.github.com/users/alexmalyshev/events{/privacy}","received_events_url":"https://api.github.com/users/alexmalyshev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexmalyshev/rsocket-cpp","description":"C++ implementation of RSocket","fork":true,"url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp","forks_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/forks","keys_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/teams","hooks_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/hooks","issue_events_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/events","assignees_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/tags","blobs_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/languages","stargazers_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/stargazers","contributors_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/contributors","subscribers_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/subscribers","subscription_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/subscription","commits_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/merges","archive_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/downloads","issues_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/labels{/name}","releases_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/alexmalyshev/rsocket-cpp/deployments","created_at":"2017-04-28T02:06:16Z","updated_at":"2017-04-28T02:06:18Z","pushed_at":"2017-09-06T20:49:28Z","git_url":"git://github.com/alexmalyshev/rsocket-cpp.git","ssh_url":"git@github.com:alexmalyshev/rsocket-cpp.git","clone_url":"https://github.com/alexmalyshev/rsocket-cpp.git","svn_url":"https://github.com/alexmalyshev/rsocket-cpp","homepage":"","size":4313,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"rsocket:master","ref":"master","sha":"2f8b398e18043d06af5f7fec14dd5c5a75872696","user":{"login":"rsocket","id":25459855,"avatar_url":"https://avatars3.githubusercontent.com/u/25459855?v=4","gravatar_id":"","url":"https://api.github.com/users/rsocket","html_url":"https://github.com/rsocket","followers_url":"https://api.github.com/users/rsocket/followers","following_url":"https://api.github.com/users/rsocket/following{/other_user}","gists_url":"https://api.github.com/users/rsocket/gists{/gist_id}","starred_url":"https://api.github.com/users/rsocket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsocket/subscriptions","organizations_url":"https://api.github.com/users/rsocket/orgs","repos_url":"https://api.github.com/users/rsocket/repos","events_url":"https://api.github.com/users/rsocket/events{/privacy}","received_events_url":"https://api.github.com/users/rsocket/received_events","type":"Organization","site_admin":false},"repo":{"id":53889141,"name":"rsocket-cpp","full_name":"rsocket/rsocket-cpp","owner":{"login":"rsocket","id":25459855,"avatar_url":"https://avatars3.githubusercontent.com/u/25459855?v=4","gravatar_id":"","url":"https://api.github.com/users/rsocket","html_url":"https://github.com/rsocket","followers_url":"https://api.github.com/users/rsocket/followers","following_url":"https://api.github.com/users/rsocket/following{/other_user}","gists_url":"https://api.github.com/users/rsocket/gists{/gist_id}","starred_url":"https://api.github.com/users/rsocket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsocket/subscriptions","organizations_url":"https://api.github.com/users/rsocket/orgs","repos_url":"https://api.github.com/users/rsocket/repos","events_url":"https://api.github.com/users/rsocket/events{/privacy}","received_events_url":"https://api.github.com/users/rsocket/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rsocket/rsocket-cpp","description":"C++ implementation of RSocket","fork":false,"url":"https://api.github.com/repos/rsocket/rsocket-cpp","forks_url":"https://api.github.com/repos/rsocket/rsocket-cpp/forks","keys_url":"https://api.github.com/repos/rsocket/rsocket-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rsocket/rsocket-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rsocket/rsocket-cpp/teams","hooks_url":"https://api.github.com/repos/rsocket/rsocket-cpp/hooks","issue_events_url":"https://api.github.com/repos/rsocket/rsocket-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/rsocket/rsocket-cpp/events","assignees_url":"https://api.github.com/repos/rsocket/rsocket-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/rsocket/rsocket-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/rsocket/rsocket-cpp/tags","blobs_url":"https://api.github.com/repos/rsocket/rsocket-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rsocket/rsocket-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rsocket/rsocket-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/rsocket/rsocket-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rsocket/rsocket-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/rsocket/rsocket-cpp/languages","stargazers_url":"https://api.github.com/repos/rsocket/rsocket-cpp/stargazers","contributors_url":"https://api.github.com/repos/rsocket/rsocket-cpp/contributors","subscribers_url":"https://api.github.com/repos/rsocket/rsocket-cpp/subscribers","subscription_url":"https://api.github.com/repos/rsocket/rsocket-cpp/subscription","commits_url":"https://api.github.com/repos/rsocket/rsocket-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/rsocket/rsocket-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/rsocket/rsocket-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/rsocket/rsocket-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/rsocket/rsocket-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/rsocket/rsocket-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rsocket/rsocket-cpp/merges","archive_url":"https://api.github.com/repos/rsocket/rsocket-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rsocket/rsocket-cpp/downloads","issues_url":"https://api.github.com/repos/rsocket/rsocket-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/rsocket/rsocket-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/rsocket/rsocket-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rsocket/rsocket-cpp/labels{/name}","releases_url":"https://api.github.com/repos/rsocket/rsocket-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/rsocket/rsocket-cpp/deployments","created_at":"2016-03-14T20:20:55Z","updated_at":"2017-08-28T23:12:43Z","pushed_at":"2017-09-06T20:49:29Z","git_url":"git://github.com/rsocket/rsocket-cpp.git","ssh_url":"git@github.com:rsocket/rsocket-cpp.git","clone_url":"https://github.com/rsocket/rsocket-cpp.git","svn_url":"https://github.com/rsocket/rsocket-cpp","homepage":"http://rsocket.io","size":4308,"stargazers_count":41,"watchers_count":41,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":21,"forks":32,"open_issues":21,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726"},"html":{"href":"https://github.com/rsocket/rsocket-cpp/pull/726"},"issue":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/issues/726"},"comments":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/issues/726/comments"},"review_comments":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726/comments"},"review_comment":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/pulls/726/commits"},"statuses":{"href":"https://api.github.com/repos/rsocket/rsocket-cpp/statuses/98f634eed3907a72aab05d21479d111545865fe0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexmalyshev"}}