{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/comments/32791941","id":32791941,"diff_hunk":"@@ -0,0 +1,111 @@\n+﻿/*\n+Project Orleans Cloud Service SDK ver. 1.0\n+ \n+Copyright (c) Microsoft Corporation\n+ \n+All rights reserved.\n+ \n+MIT License\n+\n+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and \n+associated documentation files (the \"\"Software\"\"), to deal in the Software without restriction,\n+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,\n+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,\n+subject to the following conditions:\n+\n+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n+\n+THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n+THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\n+OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n+*/\n+\n+namespace OrleansCodeGenerator\n+{\n+    using System;\n+    using System.Threading.Tasks;\n+\n+    /// <summary>\n+    /// Extension methods for <see cref=\"Task\"/>.\n+    /// </summary>\n+    public static class TaskUtility\n+    {\n+        /// <summary>\n+        /// Returns a faulted task.\n+        /// </summary>\n+        /// <param name=\"exception\">The exception which the return task faulted with.</param>\n+        /// <returns>A faulted task.</returns>\n+        public static Task<object> Faulted(Exception exception)","path":"src/OrleansCodeGenerator/TaskUtility.cs","position":39,"original_position":39,"commit_id":"062a63ea863f09f4e55719424a193320ba89c117","original_commit_id":"062a63ea863f09f4e55719424a193320ba89c117","user":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"body":"That method is internal, so it's not available to the generated assembly.","created_at":"2015-06-19T00:12:47Z","updated_at":"2015-06-19T00:12:47Z","html_url":"https://github.com/dotnet/orleans/pull/528#discussion_r32791941","pull_request_url":"https://api.github.com/repos/dotnet/orleans/pulls/528","_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments/32791941"},"html":{"href":"https://github.com/dotnet/orleans/pull/528#discussion_r32791941"},"pull_request":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/528"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/528","id":37874285,"html_url":"https://github.com/dotnet/orleans/pull/528","diff_url":"https://github.com/dotnet/orleans/pull/528.diff","patch_url":"https://github.com/dotnet/orleans/pull/528.patch","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/528","number":528,"state":"open","locked":false,"title":"Featue: Runtime Code Generation of GrainReferences & MethodInvokers","user":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"body":"This is a proposed fix for #511 & #510.\r\n\r\nRuntime code generation is loaded in the GrainFactory and kept current as new assemblies are loaded. `IGrainMethodInvoker` implementations are also loaded in `GrainTypeManager` upon initialization.\r\n\r\nRoslyn is used for generating `GrainReference`s and `IGrainMethodInvoker`s and not for generating `GrainReference` serializers, `Cast` methods, or `CreateObjectRefernce`/`DeleteObjectReference` methods . Instead, Expression Trees are used in those cases. In the case of `GrainReference` casters, they of course rely on having a generated `GrainReference` with the correct marker attribute.\r\n\r\nMarker attributes (`MethodInvokerAttribute` and `GrainReferenceAttribute`) have been changed to include a `GrainType` parameter which takes the (possibly generic) type of the grain which they relate to.\r\n\r\nThis is implemented as an optional plugin for Orleans. If `OrleansCodeGenerator.dll` is present at runtime, it will be loaded and used. If it is not present, the existing mechanism of compile-time code generation will have to suffice instead.\r\n\r\nI have not created a NuGet package, so if this is the approach we are going to take, that will need to be done before the PR is ready to merge.\r\n\r\nAll criticism is welcome :)","created_at":"2015-06-17T07:56:23Z","updated_at":"2015-06-19T00:12:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/orleans/pulls/528/commits","review_comments_url":"https://api.github.com/repos/dotnet/orleans/pulls/528/comments","review_comment_url":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/528/comments","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/062a63ea863f09f4e55719424a193320ba89c117","head":{"label":"ReubenBond:feature-runtime-codegen","ref":"feature-runtime-codegen","sha":"062a63ea863f09f4e55719424a193320ba89c117","user":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"repo":{"id":30130910,"name":"orleans","full_name":"ReubenBond/orleans","owner":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ReubenBond/orleans","description":"Repo for Orleans - Distributed Actor Model","fork":true,"url":"https://api.github.com/repos/ReubenBond/orleans","forks_url":"https://api.github.com/repos/ReubenBond/orleans/forks","keys_url":"https://api.github.com/repos/ReubenBond/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReubenBond/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReubenBond/orleans/teams","hooks_url":"https://api.github.com/repos/ReubenBond/orleans/hooks","issue_events_url":"https://api.github.com/repos/ReubenBond/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/ReubenBond/orleans/events","assignees_url":"https://api.github.com/repos/ReubenBond/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/ReubenBond/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/ReubenBond/orleans/tags","blobs_url":"https://api.github.com/repos/ReubenBond/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReubenBond/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReubenBond/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReubenBond/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReubenBond/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/ReubenBond/orleans/languages","stargazers_url":"https://api.github.com/repos/ReubenBond/orleans/stargazers","contributors_url":"https://api.github.com/repos/ReubenBond/orleans/contributors","subscribers_url":"https://api.github.com/repos/ReubenBond/orleans/subscribers","subscription_url":"https://api.github.com/repos/ReubenBond/orleans/subscription","commits_url":"https://api.github.com/repos/ReubenBond/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReubenBond/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReubenBond/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReubenBond/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReubenBond/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/ReubenBond/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReubenBond/orleans/merges","archive_url":"https://api.github.com/repos/ReubenBond/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReubenBond/orleans/downloads","issues_url":"https://api.github.com/repos/ReubenBond/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/ReubenBond/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/ReubenBond/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/ReubenBond/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReubenBond/orleans/labels{/name}","releases_url":"https://api.github.com/repos/ReubenBond/orleans/releases{/id}","created_at":"2015-02-01T00:06:08Z","updated_at":"2015-02-18T12:39:27Z","pushed_at":"2015-06-18T10:19:06Z","git_url":"git://github.com/ReubenBond/orleans.git","ssh_url":"git@github.com:ReubenBond/orleans.git","clone_url":"https://github.com/ReubenBond/orleans.git","svn_url":"https://github.com/ReubenBond/orleans","homepage":"","size":5582,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"dotnet:master","ref":"master","sha":"96db05aa42235625aefc17e8192d996013a5b3cd","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28232663,"name":"orleans","full_name":"dotnet/orleans","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/orleans","description":"Orleans - Distributed Virtual Actor Model","fork":false,"url":"https://api.github.com/repos/dotnet/orleans","forks_url":"https://api.github.com/repos/dotnet/orleans/forks","keys_url":"https://api.github.com/repos/dotnet/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/orleans/teams","hooks_url":"https://api.github.com/repos/dotnet/orleans/hooks","issue_events_url":"https://api.github.com/repos/dotnet/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/orleans/events","assignees_url":"https://api.github.com/repos/dotnet/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/orleans/tags","blobs_url":"https://api.github.com/repos/dotnet/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/orleans/languages","stargazers_url":"https://api.github.com/repos/dotnet/orleans/stargazers","contributors_url":"https://api.github.com/repos/dotnet/orleans/contributors","subscribers_url":"https://api.github.com/repos/dotnet/orleans/subscribers","subscription_url":"https://api.github.com/repos/dotnet/orleans/subscription","commits_url":"https://api.github.com/repos/dotnet/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/orleans/merges","archive_url":"https://api.github.com/repos/dotnet/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/orleans/downloads","issues_url":"https://api.github.com/repos/dotnet/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/orleans/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/orleans/releases{/id}","created_at":"2014-12-19T14:32:50Z","updated_at":"2015-06-18T21:28:32Z","pushed_at":"2015-06-18T21:32:30Z","git_url":"git://github.com/dotnet/orleans.git","ssh_url":"git@github.com:dotnet/orleans.git","clone_url":"https://github.com/dotnet/orleans.git","svn_url":"https://github.com/dotnet/orleans","homepage":"http://dotnet.github.io/orleans","size":28462,"stargazers_count":994,"watchers_count":994,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":217,"mirror_url":null,"open_issues_count":69,"forks":217,"open_issues":69,"watchers":994,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/528"},"html":{"href":"https://github.com/dotnet/orleans/pull/528"},"issue":{"href":"https://api.github.com/repos/dotnet/orleans/issues/528"},"comments":{"href":"https://api.github.com/repos/dotnet/orleans/issues/528/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/528/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/528/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/orleans/statuses/062a63ea863f09f4e55719424a193320ba89c117"}}}}