private LocalActorRef CreateUserGuardian(LocalActorRef rootGuardian, string name) //Corresponds to Akka's: override lazy val guardian: LocalActorRef { var cell = rootGuardian.Cell; cell.ReserveChild(name); // make user provided guardians not run on internal dispatcher MessageDispatcher dispatcher; if (_system.GuardianProps.IsEmpty) { dispatcher = InternalDispatcher; } else { var props = _system.GuardianProps.Value; var dispatcherId = props.Deploy.Dispatcher == Deploy.DispatcherSameAsParent ? Dispatchers.DefaultDispatcherId : props.Dispatcher; dispatcher = _system.Dispatchers.Lookup(dispatcherId); } var userGuardian = new LocalActorRef( _system, _system.GuardianProps.GetOrElse(Props.Create <GuardianActor>(UserGuardianSupervisorStrategy)), dispatcher, _defaultMailbox, rootGuardian, RootPath / name); cell.InitChild(userGuardian); userGuardian.Start(); return(userGuardian); }
private LocalActorRef CreateSystemGuardian(LocalActorRef rootGuardian, string name, LocalActorRef userGuardian) //Corresponds to Akka's: override lazy val guardian: systemGuardian { var cell = rootGuardian.Cell; cell.ReserveChild(name); var props = Props.Create(() => new SystemGuardianActor(userGuardian), _systemGuardianStrategy); var systemGuardian = new LocalActorRef(_system, props, InternalDispatcher, _defaultMailbox, rootGuardian, RootPath / name); cell.InitChild(systemGuardian); systemGuardian.Start(); return(systemGuardian); }
private LocalActorRef CreateUserGuardian(LocalActorRef rootGuardian, string name) //Corresponds to Akka's: override lazy val guardian: LocalActorRef { var cell = rootGuardian.Cell; cell.ReserveChild(name); var props = Props.Create <GuardianActor>(UserGuardianSupervisorStrategy); var userGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath / name); cell.InitChild(userGuardian); userGuardian.Start(); return(userGuardian); }
private LocalActorRef CreateSystemGuardian(LocalActorRef rootGuardian, string name, LocalActorRef userGuardian) //Corresponds to Akka's: override lazy val guardian: systemGuardian { var cell = rootGuardian.Cell; cell.ReserveChild(name); var props = Props.Create(() => new SystemGuardianActor(userGuardian), _systemGuardianStrategy); var systemGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath / name); cell.InitChild(systemGuardian); systemGuardian.Start(); return systemGuardian; }
private LocalActorRef CreateUserGuardian(LocalActorRef rootGuardian, string name) //Corresponds to Akka's: override lazy val guardian: LocalActorRef { var cell = rootGuardian.Cell; cell.ReserveChild(name); var props = Props.Create<GuardianActor>(UserGuardianSupervisorStrategy); var userGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath / name); cell.InitChild(userGuardian); userGuardian.Start(); return userGuardian; }