Page History
View filewidget | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
// Create ActorSystem var actorSystem = akkaService.CreateActorSystem(); // Create RoundRobin Router var roundrobin = actorSystem.ActorOf(Props.Create<BasicActor>().WithRouter(new RoundRobinPool(0))); // Create Throttle And connect Router int tps = 1; var throttle = actorSystem.ActorOf(Props.Create(() => new ThrottleActor(tps))); throttle.Tell(new SetTarget(roundrobin)); // Create Worker and Add Routee var workActor = ActorSystem.ActorOf(Props.Create<BasicActor>(), NodeName); var routee = Routee.FromActorRef(workActor); roundrobin.Tell(new AddRoutee(routee)); // Say Hello throttle.Tell(new TodoQueue() { Todo = new Todo() { Id = i.ToString(), Title = ""Hello"" } }); |
...