{"action":"created","issue":{"url":"https://api.github.com/repos/AsynkronIT/protoactor-dotnet/issues/80","repository_url":"https://api.github.com/repos/AsynkronIT/protoactor-dotnet","labels_url":"https://api.github.com/repos/AsynkronIT/protoactor-dotnet/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/AsynkronIT/protoactor-dotnet/issues/80/comments","events_url":"https://api.github.com/repos/AsynkronIT/protoactor-dotnet/issues/80/events","html_url":"https://github.com/AsynkronIT/protoactor-dotnet/issues/80","id":213994685,"number":80,"title":"async / await using in Actor","user":{"login":"koderhari","id":17511191,"avatar_url":"https://avatars2.githubusercontent.com/u/17511191?v=3","gravatar_id":"","url":"https://api.github.com/users/koderhari","html_url":"https://github.com/koderhari","followers_url":"https://api.github.com/users/koderhari/followers","following_url":"https://api.github.com/users/koderhari/following{/other_user}","gists_url":"https://api.github.com/users/koderhari/gists{/gist_id}","starred_url":"https://api.github.com/users/koderhari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koderhari/subscriptions","organizations_url":"https://api.github.com/users/koderhari/orgs","repos_url":"https://api.github.com/users/koderhari/repos","events_url":"https://api.github.com/users/koderhari/events{/privacy}","received_events_url":"https://api.github.com/users/koderhari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-03-14T08:05:39Z","updated_at":"2017-03-14T17:31:05Z","closed_at":null,"body":"Hello, i have next problem.\r\nI have .net core web application created from template (.net core 1.1)\r\nIn Configure method of Startup class i spawn actor and store PID in static field.\r\nThen i send message to Actor in Controller Get Method.\r\nActor receive only first (firstly open page) and second (after refresh page) messages,\r\nbut next messages doesn't receive.\r\nIf i delete async, it works correctrly.\r\nIs it bug or ProtoActor doesn't support async calling?\r\n        \r\n    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\r\n        {\r\n            loggerFactory.AddConsole(Configuration.GetSection(\"Logging\"));\r\n            loggerFactory.AddDebug();\r\n            var props = Actor.FromProducer(() => new HelloActor());\r\n            pid = Actor.Spawn(props);\r\n            app.UseMvc();\r\n        }  \r\n      // actor\r\n       internal class HelloActor : IActor\r\n        {\r\n            public async Task ReceiveAsync(IContext context)\r\n            {\r\n                var msg = context.Message;\r\n                if (msg is Hello)\r\n                {\r\n                    await Task.Delay(5000);\r\n                    Console.WriteLine($\"Hello {((Hello)msg).Who}\");\r\n                    context.Sender.Tell(999);\r\n                }\r\n            }\r\n        }\r\n       // controller\r\n        [HttpGet]\r\n        public IEnumerable<string> Get()\r\n        {\r\n            Startup.pid.Tell(new Hello\r\n            {\r\n                Who = \"Alex\"\r\n            });\r\n            return new string[] { \"value1\", \"value2\" };\r\n        }\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/AsynkronIT/protoactor-dotnet/issues/comments/286498581","html_url":"https://github.com/AsynkronIT/protoactor-dotnet/issues/80#issuecomment-286498581","issue_url":"https://api.github.com/repos/AsynkronIT/protoactor-dotnet/issues/80","id":286498581,"user":{"login":"cpx86","id":209890,"avatar_url":"https://avatars1.githubusercontent.com/u/209890?v=3","gravatar_id":"","url":"https://api.github.com/users/cpx86","html_url":"https://github.com/cpx86","followers_url":"https://api.github.com/users/cpx86/followers","following_url":"https://api.github.com/users/cpx86/following{/other_user}","gists_url":"https://api.github.com/users/cpx86/gists{/gist_id}","starred_url":"https://api.github.com/users/cpx86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpx86/subscriptions","organizations_url":"https://api.github.com/users/cpx86/orgs","repos_url":"https://api.github.com/users/cpx86/repos","events_url":"https://api.github.com/users/cpx86/events{/privacy}","received_events_url":"https://api.github.com/users/cpx86/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T17:31:05Z","updated_at":"2017-03-14T17:31:05Z","body":"Awesome!"}}
{"actor":{"display_login":"cpx86"}}