Пример #1
0
 protected override System.Threading.Tasks.Task OnInitializeAsync(Event initialEvent)
 {
     if (initialEvent is RequestEvent <TRequest, TResult> req)
     {
         this.Request = req;
         ProcessRequest(req.Request);
     }
     return(base.OnInitializeAsync(initialEvent));
 }
Пример #2
0
        public static async Task Execute(IActorRuntime runtime)
        {
            var request = new RequestEvent <string, string>("Hi Mom!");

            ActorId id = runtime.CreateActor(typeof(ExampleHttpServer), request);

            var response = await request.Completed.Task;

            runtime.SendEvent(id, HaltEvent.Instance);
        }