{"action":"opened","number":117,"pull_request":{"url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/117","id":60123224,"html_url":"https://github.com/couchbaselabs/Linq2Couchbase/pull/117","diff_url":"https://github.com/couchbaselabs/Linq2Couchbase/pull/117.diff","patch_url":"https://github.com/couchbaselabs/Linq2Couchbase/pull/117.patch","issue_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/117","number":117,"state":"open","locked":false,"title":"LINQ-27: Asynchronous LINQ query support","user":{"login":"brantburnett","id":7118719,"avatar_url":"https://avatars.githubusercontent.com/u/7118719?v=3","gravatar_id":"","url":"https://api.github.com/users/brantburnett","html_url":"https://github.com/brantburnett","followers_url":"https://api.github.com/users/brantburnett/followers","following_url":"https://api.github.com/users/brantburnett/following{/other_user}","gists_url":"https://api.github.com/users/brantburnett/gists{/gist_id}","starred_url":"https://api.github.com/users/brantburnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantburnett/subscriptions","organizations_url":"https://api.github.com/users/brantburnett/orgs","repos_url":"https://api.github.com/users/brantburnett/repos","events_url":"https://api.github.com/users/brantburnett/events{/privacy}","received_events_url":"https://api.github.com/users/brantburnett/received_events","type":"User","site_admin":false},"body":"Motivation\r\n----------\r\nProvide a transparent, easy to use mechanism for consumers to execute LINQ\r\nqueries against Couchbase asynchronously.  This should include support for\r\nqueries which use scalar result operations, such as .First(), .Sum(),\r\n.Any(), etc.\r\n\r\nModifications\r\n-------------\r\nCreated LinqQueryRequest as an extension of the SDK QueryRequest.  It\r\nprovides additional properties specific to the execution of queries\r\ncreated for LINQ.  Refactored BucketQueryExecutor to use this construct\r\ninternally for query execution.\r\n\r\nCreated IBucketQueryExecutor to extend IQueryExecutor, which provides\r\nextensions to execute the query asynchronously by providing a\r\nLinqQueryRequest.  Extended BucketQueryable with the new interface\r\nIBucketQueryExecutorProvider to give an method for internal consumers to\r\naccess the IBucketQueryExecutor.\r\n\r\nCreated ToQueryRequestExpressionNode, ToQueryRequestResultOperator,\r\nLinqQueryRequestDataInfo, and LinqQueryRequestValue to allow for fake\r\nquery execution.  This fake query execution doesn't actually run against\r\nthe bucket, but instead creates the LinqQueryRequest and returns it.\r\nThis process can be easily triggered via\r\nLinqQueryRequest.CreateQueryRequest.\r\n\r\nExtended IQueryable with two overloads of ExecuteAsync, both of which\r\nexecute a query against a bucket asynchronously.  The first returns an\r\nIEnumerable.  The second takes an additional lambda, and returns a scalar\r\nresult.  This is used to apply immediately executed result operators, such\r\nas .First(), .Sum(), .Any(), etc.\r\n\r\nIn order to provide support for .Any() and .All(), refactored the handling\r\nof result extraction for these operations.  Previously this was handled\r\ndirectly in BucketQueryExecutor.ExecuteScalar, but this method isn't used\r\nwhen executing asynchronously.  Now settings related to this are stored in\r\nScalarResultBehavior on LinqQueryRequest, and the calls to\r\nExecuteCollection and ExecuteCollectionAsync apply the configured behavior\r\nautomatically.\r\n\r\nResults\r\n-------\r\nAny LINQ query against a bucket can now be executed asynchronously.  This\r\nis done with only a very small change to the exposed API, the two\r\noverloads of ExecuteAsync which extend IQueryable.\r\n\r\nAdditionally, the use of LinqQueryRequest internally lays the groundwork\r\nfor further extensions which support query parameters such as scan\r\nconsistency.","created_at":"2016-02-22T04:12:46Z","updated_at":"2016-02-22T04:12:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/117/commits","review_comments_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/117/comments","review_comment_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/117/comments","statuses_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/statuses/8d5196a03e4b8fc30b0feada48786446d93f06cc","head":{"label":"brantburnett:async","ref":"async","sha":"8d5196a03e4b8fc30b0feada48786446d93f06cc","user":{"login":"brantburnett","id":7118719,"avatar_url":"https://avatars.githubusercontent.com/u/7118719?v=3","gravatar_id":"","url":"https://api.github.com/users/brantburnett","html_url":"https://github.com/brantburnett","followers_url":"https://api.github.com/users/brantburnett/followers","following_url":"https://api.github.com/users/brantburnett/following{/other_user}","gists_url":"https://api.github.com/users/brantburnett/gists{/gist_id}","starred_url":"https://api.github.com/users/brantburnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantburnett/subscriptions","organizations_url":"https://api.github.com/users/brantburnett/orgs","repos_url":"https://api.github.com/users/brantburnett/repos","events_url":"https://api.github.com/users/brantburnett/events{/privacy}","received_events_url":"https://api.github.com/users/brantburnett/received_events","type":"User","site_admin":false},"repo":{"id":36899716,"name":"Linq2Couchbase","full_name":"brantburnett/Linq2Couchbase","owner":{"login":"brantburnett","id":7118719,"avatar_url":"https://avatars.githubusercontent.com/u/7118719?v=3","gravatar_id":"","url":"https://api.github.com/users/brantburnett","html_url":"https://github.com/brantburnett","followers_url":"https://api.github.com/users/brantburnett/followers","following_url":"https://api.github.com/users/brantburnett/following{/other_user}","gists_url":"https://api.github.com/users/brantburnett/gists{/gist_id}","starred_url":"https://api.github.com/users/brantburnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantburnett/subscriptions","organizations_url":"https://api.github.com/users/brantburnett/orgs","repos_url":"https://api.github.com/users/brantburnett/repos","events_url":"https://api.github.com/users/brantburnett/events{/privacy}","received_events_url":"https://api.github.com/users/brantburnett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brantburnett/Linq2Couchbase","description":"A Language Integrated Query (LINQ) provider for the Couchbase .NET SDK","fork":true,"url":"https://api.github.com/repos/brantburnett/Linq2Couchbase","forks_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/forks","keys_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/teams","hooks_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/hooks","issue_events_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/issues/events{/number}","events_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/events","assignees_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/assignees{/user}","branches_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/branches{/branch}","tags_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/tags","blobs_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/refs{/sha}","trees_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/statuses/{sha}","languages_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/languages","stargazers_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/stargazers","contributors_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/contributors","subscribers_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/subscribers","subscription_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/subscription","commits_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/commits{/sha}","git_commits_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/commits{/sha}","comments_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/comments{/number}","issue_comment_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/issues/comments{/number}","contents_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/contents/{+path}","compare_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/merges","archive_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/downloads","issues_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/issues{/number}","pulls_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/pulls{/number}","milestones_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/milestones{/number}","notifications_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/labels{/name}","releases_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/releases{/id}","deployments_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/deployments","created_at":"2015-06-04T22:50:39Z","updated_at":"2016-01-17T18:04:47Z","pushed_at":"2016-02-22T04:10:16Z","git_url":"git://github.com/brantburnett/Linq2Couchbase.git","ssh_url":"git@github.com:brantburnett/Linq2Couchbase.git","clone_url":"https://github.com/brantburnett/Linq2Couchbase.git","svn_url":"https://github.com/brantburnett/Linq2Couchbase","homepage":null,"size":1066,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"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":"couchbaselabs:master","ref":"master","sha":"219832bae73394ad64e22bdd55d172b87bc2f92e","user":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"repo":{"id":24389293,"name":"Linq2Couchbase","full_name":"couchbaselabs/Linq2Couchbase","owner":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/couchbaselabs/Linq2Couchbase","description":"A Language Integrated Query (LINQ) provider for the Couchbase .NET SDK","fork":false,"url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase","forks_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/forks","keys_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/teams","hooks_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/hooks","issue_events_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/events{/number}","events_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/events","assignees_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/assignees{/user}","branches_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/branches{/branch}","tags_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/tags","blobs_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/languages","stargazers_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/stargazers","contributors_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/contributors","subscribers_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/subscribers","subscription_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/subscription","commits_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/contents/{+path}","compare_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/merges","archive_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/downloads","issues_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues{/number}","pulls_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/labels{/name}","releases_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/releases{/id}","deployments_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/deployments","created_at":"2014-09-23T21:02:02Z","updated_at":"2016-02-21T03:27:54Z","pushed_at":"2016-02-17T18:51:08Z","git_url":"git://github.com/couchbaselabs/Linq2Couchbase.git","ssh_url":"git@github.com:couchbaselabs/Linq2Couchbase.git","clone_url":"https://github.com/couchbaselabs/Linq2Couchbase.git","svn_url":"https://github.com/couchbaselabs/Linq2Couchbase","homepage":null,"size":1058,"stargazers_count":21,"watchers_count":21,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":2,"forks":13,"open_issues":2,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/117"},"html":{"href":"https://github.com/couchbaselabs/Linq2Couchbase/pull/117"},"issue":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/117"},"comments":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/statuses/8d5196a03e4b8fc30b0feada48786446d93f06cc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1013,"deletions":71,"changed_files":21}}