{"action":"created","comment":{"url":"https://api.github.com/repos/elsid/apq/pulls/comments/158801893","pull_request_review_id":85658368,"id":158801893,"diff_hunk":"@@ -0,0 +1,71 @@\n+#pragma once\n+\n+#include <apq/connection.h>\n+#include <apq/impl/async_connect.h>\n+\n+#include <chrono>\n+\n+namespace libapq {\n+namespace detail {\n+\n+template <typename Handler, typename Connection>\n+struct connection_handler_binder {\n+    Handler handler_;\n+    Connection conn_;\n+\n+    void operator() (error_code ec) {\n+        handler_(std::move(ec), std::move(conn_));\n+    }\n+\n+    template <typename Func>\n+    friend void asio_handler_invoke(Func&& f, connection_handler_binder* ctx) {\n+        using ::boost::asio::asio_handler_invoke;\n+        asio_handler_invoke(std::forward<Func>(f), \n+            std::addressof(ctx->handler_));\n+    }\n+};\n+\n+template <typename Handler, typename Connection>\n+inline auto bind_connection_handler(Handler&& base, Connection&& conn) {\n+    return connection_handler_binder<std::decay_t<Handler>, std::decay_t<Connection>> {\n+        std::forward<Handler>(base), std::forward<Connection>(conn)\n+    };\n+}\n+\n+} // namespace detail\n+\n+template <\n+    typename OidMap = empty_oid_map, \n+    typename Statistics = no_statistics>\n+class connection_info {\n+    io_context& io_;\n+    std::string raw_;","path":"include/apq/connection_info.h","position":42,"original_position":42,"commit_id":"a58c33a8e649df5b3e20e784f3b03c6e57b21179","original_commit_id":"a58c33a8e649df5b3e20e784f3b03c6e57b21179","user":{"login":"elsid","id":764107,"avatar_url":"https://avatars2.githubusercontent.com/u/764107?v=4","gravatar_id":"","url":"https://api.github.com/users/elsid","html_url":"https://github.com/elsid","followers_url":"https://api.github.com/users/elsid/followers","following_url":"https://api.github.com/users/elsid/following{/other_user}","gists_url":"https://api.github.com/users/elsid/gists{/gist_id}","starred_url":"https://api.github.com/users/elsid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elsid/subscriptions","organizations_url":"https://api.github.com/users/elsid/orgs","repos_url":"https://api.github.com/users/elsid/repos","events_url":"https://api.github.com/users/elsid/events{/privacy}","received_events_url":"https://api.github.com/users/elsid/received_events","type":"User","site_admin":false},"body":"Does connection_info require to own connection info string? Why don't just use string_view?","created_at":"2017-12-27T11:41:38Z","updated_at":"2017-12-27T12:04:10Z","html_url":"https://github.com/elsid/apq/pull/7#discussion_r158801893","pull_request_url":"https://api.github.com/repos/elsid/apq/pulls/7","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/elsid/apq/pulls/comments/158801893"},"html":{"href":"https://github.com/elsid/apq/pull/7#discussion_r158801893"},"pull_request":{"href":"https://api.github.com/repos/elsid/apq/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/elsid/apq/pulls/7","id":160110111,"html_url":"https://github.com/elsid/apq/pull/7","diff_url":"https://github.com/elsid/apq/pull/7.diff","patch_url":"https://github.com/elsid/apq/pull/7.patch","issue_url":"https://api.github.com/repos/elsid/apq/issues/7","number":7,"state":"open","locked":false,"title":"Add connection implementation.","user":{"login":"thed636","id":2856215,"avatar_url":"https://avatars2.githubusercontent.com/u/2856215?v=4","gravatar_id":"","url":"https://api.github.com/users/thed636","html_url":"https://github.com/thed636","followers_url":"https://api.github.com/users/thed636/followers","following_url":"https://api.github.com/users/thed636/following{/other_user}","gists_url":"https://api.github.com/users/thed636/gists{/gist_id}","starred_url":"https://api.github.com/users/thed636/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thed636/subscriptions","organizations_url":"https://api.github.com/users/thed636/orgs","repos_url":"https://api.github.com/users/thed636/repos","events_url":"https://api.github.com/users/thed636/events{/privacy}","received_events_url":"https://api.github.com/users/thed636/received_events","type":"User","site_admin":false},"body":"Connection is a category which is defined in apq/connection.h\r\nTo obtain connection ConnectionProvider must exists. ConnectionProvider\r\ncategory is defined in apq/connection.h too. Connection is\r\nConnectionProvider itself. To obtain a connection from connection\r\nprovider get_connection() function exists.\r\nConnectiable is a category of objects which contains Connection.\r\nConnection is Connectiable itself. Wrapped connection is Connectiable\r\nif wrapper is ConnectionWrapper.\r\n\r\nThe basic implementation of the Connection category can be found\r\nin apq/impl/connection.h.\r\n\r\nCalss connection_info is a ConnectionProvider which creates connection\r\nvia connection info string. To perform the connection async_connect\r\noperation is defined.","created_at":"2017-12-26T10:03:42Z","updated_at":"2017-12-27T12:04:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f955f3c7103f7e9dbc036fa86cfa3bf35dee848c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/elsid/apq/pulls/7/commits","review_comments_url":"https://api.github.com/repos/elsid/apq/pulls/7/comments","review_comment_url":"https://api.github.com/repos/elsid/apq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elsid/apq/issues/7/comments","statuses_url":"https://api.github.com/repos/elsid/apq/statuses/a58c33a8e649df5b3e20e784f3b03c6e57b21179","head":{"label":"elsid:connection_impl","ref":"connection_impl","sha":"a58c33a8e649df5b3e20e784f3b03c6e57b21179","user":{"login":"elsid","id":764107,"avatar_url":"https://avatars2.githubusercontent.com/u/764107?v=4","gravatar_id":"","url":"https://api.github.com/users/elsid","html_url":"https://github.com/elsid","followers_url":"https://api.github.com/users/elsid/followers","following_url":"https://api.github.com/users/elsid/following{/other_user}","gists_url":"https://api.github.com/users/elsid/gists{/gist_id}","starred_url":"https://api.github.com/users/elsid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elsid/subscriptions","organizations_url":"https://api.github.com/users/elsid/orgs","repos_url":"https://api.github.com/users/elsid/repos","events_url":"https://api.github.com/users/elsid/events{/privacy}","received_events_url":"https://api.github.com/users/elsid/received_events","type":"User","site_admin":false},"repo":{"id":106461599,"name":"apq","full_name":"elsid/apq","owner":{"login":"elsid","id":764107,"avatar_url":"https://avatars2.githubusercontent.com/u/764107?v=4","gravatar_id":"","url":"https://api.github.com/users/elsid","html_url":"https://github.com/elsid","followers_url":"https://api.github.com/users/elsid/followers","following_url":"https://api.github.com/users/elsid/following{/other_user}","gists_url":"https://api.github.com/users/elsid/gists{/gist_id}","starred_url":"https://api.github.com/users/elsid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elsid/subscriptions","organizations_url":"https://api.github.com/users/elsid/orgs","repos_url":"https://api.github.com/users/elsid/repos","events_url":"https://api.github.com/users/elsid/events{/privacy}","received_events_url":"https://api.github.com/users/elsid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/elsid/apq","description":null,"fork":false,"url":"https://api.github.com/repos/elsid/apq","forks_url":"https://api.github.com/repos/elsid/apq/forks","keys_url":"https://api.github.com/repos/elsid/apq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elsid/apq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elsid/apq/teams","hooks_url":"https://api.github.com/repos/elsid/apq/hooks","issue_events_url":"https://api.github.com/repos/elsid/apq/issues/events{/number}","events_url":"https://api.github.com/repos/elsid/apq/events","assignees_url":"https://api.github.com/repos/elsid/apq/assignees{/user}","branches_url":"https://api.github.com/repos/elsid/apq/branches{/branch}","tags_url":"https://api.github.com/repos/elsid/apq/tags","blobs_url":"https://api.github.com/repos/elsid/apq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elsid/apq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elsid/apq/git/refs{/sha}","trees_url":"https://api.github.com/repos/elsid/apq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elsid/apq/statuses/{sha}","languages_url":"https://api.github.com/repos/elsid/apq/languages","stargazers_url":"https://api.github.com/repos/elsid/apq/stargazers","contributors_url":"https://api.github.com/repos/elsid/apq/contributors","subscribers_url":"https://api.github.com/repos/elsid/apq/subscribers","subscription_url":"https://api.github.com/repos/elsid/apq/subscription","commits_url":"https://api.github.com/repos/elsid/apq/commits{/sha}","git_commits_url":"https://api.github.com/repos/elsid/apq/git/commits{/sha}","comments_url":"https://api.github.com/repos/elsid/apq/comments{/number}","issue_comment_url":"https://api.github.com/repos/elsid/apq/issues/comments{/number}","contents_url":"https://api.github.com/repos/elsid/apq/contents/{+path}","compare_url":"https://api.github.com/repos/elsid/apq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elsid/apq/merges","archive_url":"https://api.github.com/repos/elsid/apq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elsid/apq/downloads","issues_url":"https://api.github.com/repos/elsid/apq/issues{/number}","pulls_url":"https://api.github.com/repos/elsid/apq/pulls{/number}","milestones_url":"https://api.github.com/repos/elsid/apq/milestones{/number}","notifications_url":"https://api.github.com/repos/elsid/apq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elsid/apq/labels{/name}","releases_url":"https://api.github.com/repos/elsid/apq/releases{/id}","deployments_url":"https://api.github.com/repos/elsid/apq/deployments","created_at":"2017-10-10T19:24:45Z","updated_at":"2017-12-17T10:33:57Z","pushed_at":"2017-12-26T14:51:54Z","git_url":"git://github.com/elsid/apq.git","ssh_url":"git@github.com:elsid/apq.git","clone_url":"https://github.com/elsid/apq.git","svn_url":"https://github.com/elsid/apq","homepage":null,"size":60,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"elsid:master","ref":"master","sha":"c5958ae55d68b23eade9f573b0e72f0d4f2f9f41","user":{"login":"elsid","id":764107,"avatar_url":"https://avatars2.githubusercontent.com/u/764107?v=4","gravatar_id":"","url":"https://api.github.com/users/elsid","html_url":"https://github.com/elsid","followers_url":"https://api.github.com/users/elsid/followers","following_url":"https://api.github.com/users/elsid/following{/other_user}","gists_url":"https://api.github.com/users/elsid/gists{/gist_id}","starred_url":"https://api.github.com/users/elsid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elsid/subscriptions","organizations_url":"https://api.github.com/users/elsid/orgs","repos_url":"https://api.github.com/users/elsid/repos","events_url":"https://api.github.com/users/elsid/events{/privacy}","received_events_url":"https://api.github.com/users/elsid/received_events","type":"User","site_admin":false},"repo":{"id":106461599,"name":"apq","full_name":"elsid/apq","owner":{"login":"elsid","id":764107,"avatar_url":"https://avatars2.githubusercontent.com/u/764107?v=4","gravatar_id":"","url":"https://api.github.com/users/elsid","html_url":"https://github.com/elsid","followers_url":"https://api.github.com/users/elsid/followers","following_url":"https://api.github.com/users/elsid/following{/other_user}","gists_url":"https://api.github.com/users/elsid/gists{/gist_id}","starred_url":"https://api.github.com/users/elsid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elsid/subscriptions","organizations_url":"https://api.github.com/users/elsid/orgs","repos_url":"https://api.github.com/users/elsid/repos","events_url":"https://api.github.com/users/elsid/events{/privacy}","received_events_url":"https://api.github.com/users/elsid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/elsid/apq","description":null,"fork":false,"url":"https://api.github.com/repos/elsid/apq","forks_url":"https://api.github.com/repos/elsid/apq/forks","keys_url":"https://api.github.com/repos/elsid/apq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elsid/apq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elsid/apq/teams","hooks_url":"https://api.github.com/repos/elsid/apq/hooks","issue_events_url":"https://api.github.com/repos/elsid/apq/issues/events{/number}","events_url":"https://api.github.com/repos/elsid/apq/events","assignees_url":"https://api.github.com/repos/elsid/apq/assignees{/user}","branches_url":"https://api.github.com/repos/elsid/apq/branches{/branch}","tags_url":"https://api.github.com/repos/elsid/apq/tags","blobs_url":"https://api.github.com/repos/elsid/apq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elsid/apq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elsid/apq/git/refs{/sha}","trees_url":"https://api.github.com/repos/elsid/apq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elsid/apq/statuses/{sha}","languages_url":"https://api.github.com/repos/elsid/apq/languages","stargazers_url":"https://api.github.com/repos/elsid/apq/stargazers","contributors_url":"https://api.github.com/repos/elsid/apq/contributors","subscribers_url":"https://api.github.com/repos/elsid/apq/subscribers","subscription_url":"https://api.github.com/repos/elsid/apq/subscription","commits_url":"https://api.github.com/repos/elsid/apq/commits{/sha}","git_commits_url":"https://api.github.com/repos/elsid/apq/git/commits{/sha}","comments_url":"https://api.github.com/repos/elsid/apq/comments{/number}","issue_comment_url":"https://api.github.com/repos/elsid/apq/issues/comments{/number}","contents_url":"https://api.github.com/repos/elsid/apq/contents/{+path}","compare_url":"https://api.github.com/repos/elsid/apq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elsid/apq/merges","archive_url":"https://api.github.com/repos/elsid/apq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elsid/apq/downloads","issues_url":"https://api.github.com/repos/elsid/apq/issues{/number}","pulls_url":"https://api.github.com/repos/elsid/apq/pulls{/number}","milestones_url":"https://api.github.com/repos/elsid/apq/milestones{/number}","notifications_url":"https://api.github.com/repos/elsid/apq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elsid/apq/labels{/name}","releases_url":"https://api.github.com/repos/elsid/apq/releases{/id}","deployments_url":"https://api.github.com/repos/elsid/apq/deployments","created_at":"2017-10-10T19:24:45Z","updated_at":"2017-12-17T10:33:57Z","pushed_at":"2017-12-26T14:51:54Z","git_url":"git://github.com/elsid/apq.git","ssh_url":"git@github.com:elsid/apq.git","clone_url":"https://github.com/elsid/apq.git","svn_url":"https://github.com/elsid/apq","homepage":null,"size":60,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elsid/apq/pulls/7"},"html":{"href":"https://github.com/elsid/apq/pull/7"},"issue":{"href":"https://api.github.com/repos/elsid/apq/issues/7"},"comments":{"href":"https://api.github.com/repos/elsid/apq/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/elsid/apq/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/elsid/apq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elsid/apq/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/elsid/apq/statuses/a58c33a8e649df5b3e20e784f3b03c6e57b21179"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"elsid"}}