/// <summary> /// TBD /// </summary> /// <param name="envelope">TBD</param> public override void SendMessage(Envelope envelope) { if (RouterConfig.IsManagementMessage(envelope.Message)) { base.SendMessage(envelope); } else { Router.Route(envelope.Message, envelope.Sender); } }
public override void SendMessage(IActorRef sender, object message) { if (RouterConfig.IsManagementMessage(message)) { base.SendMessage(sender, message); } else { Router.Route(message, sender); } }
private void SendMessage(IActorRef sender, object message) { //Route the message via the router to the selected destination. if (_routerConfig.IsManagementMessage(message)) { base.Post(sender, message); } else { _router.Route(message, sender); } }
public RoundRobinLogicActor() { var n = 0; var router = new Router(new RoundRobinRoutingLogic()); Receive<Props>(p => { n++; var c = Context.ActorOf(p, "child-" + n); Context.Watch(c); router = router.AddRoutee(c); }); Receive<Terminated>(terminated => { router = router.RemoveRoutee(terminated.ActorRef); if (!router.Routees.Any()) { Context.Stop(Self); } }); ReceiveAny(other => { router.Route(other, Sender); }); }