privateasync Task RunAsync(CancellationToken cancellationToken) { // Create an instance to the top-level user Actor var workerRoleActor = _actorSystem.ActorOf<WorkerRoleActor>("WorkerRole");
// Send a message to the Actor workerRoleActor.Tell(new WorkerRoleMessage("Hello World!"));
while (!cancellationToken.IsCancellationRequested) { await Task.Delay(1000); } } } }