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)); }
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); }