public PreRestartException(LocalActorRef actor, Exception restartException, Exception cause, object optionalMessage) { Actor = actor; e = restartException; exception = cause; this.optionalMessage = optionalMessage; }
public ActorCell(ActorSystem system, string name, Mailbox mailbox) { Parent = null; System = system; Self = new LocalActorRef(new RootActorPath(System.Provider.Address, name), this); Props = null; Dispatcher = System.Dispatchers.FromConfig("akka.actor.default-dispatcher"); mailbox.Setup(Dispatcher); Mailbox = mailbox; Mailbox.ActorCell = this; }
private LocalActorRef CreateSystemGuardian(LocalActorRef rootGuardian, string name, LocalActorRef userGuardian) //Corresponds to Akka's: override lazy val guardian: systemGuardian { //TODO: When SystemGuardianActor has been implemented switch to this: //return CreateRootGuardianChild(rootGuardian, name, () => //{ // var props = Props.Create(() => new SystemGuardianActor(userGuardian), _systemGuardianStrategy); // var systemGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath / name); // return systemGuardian; //}); return((LocalActorRef)rootGuardian.Cell.ActorOf <GuardianActor>(name)); }
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); }
public void Init(ActorSystemImpl system) { _system = system; //The following are the lazy val statements in Akka var defaultDispatcher = system.Dispatchers.DefaultGlobalDispatcher; _defaultMailbox = () => new ConcurrentQueueMailbox(); //TODO:system.Mailboxes.FromConfig(Mailboxes.DefaultMailboxId) _rootGuardian = CreateRootGuardian(system); _tempContainer = new VirtualPathContainer(system.Provider, _tempNode, _rootGuardian, _log); _rootGuardian.SetTempContainer(_tempContainer); _userGuardian = CreateUserGuardian(_rootGuardian, "user"); _systemGuardian = CreateSystemGuardian(_rootGuardian, "system", _userGuardian); //End of lazy val _rootGuardian.Start(); // chain death watchers so that killing guardian stops the application _systemGuardian.Tell(new Watch(_userGuardian, _systemGuardian)); //Should be SendSystemMessage _rootGuardian.Tell(new Watch(_systemGuardian, _rootGuardian)); //Should be SendSystemMessage _eventStream.StartDefaultLoggers(_system); }
public void Init(ActorSystemImpl system) { _system = system; //The following are the lazy val statements in Akka var defaultDispatcher = system.Dispatchers.DefaultGlobalDispatcher; _defaultMailbox = () => new ConcurrentQueueMailbox(); //TODO:system.Mailboxes.FromConfig(Mailboxes.DefaultMailboxId) _rootGuardian = CreateRootGuardian(system); _tempContainer = new VirtualPathContainer(system.Provider, _tempNode, _rootGuardian, _log); _rootGuardian.SetTempContainer(_tempContainer); _userGuardian = CreateUserGuardian(_rootGuardian, "user"); _systemGuardian = CreateSystemGuardian(_rootGuardian, "system", _userGuardian); //End of lazy val _rootGuardian.Start(); // chain death watchers so that killing guardian stops the application _systemGuardian.SendSystemMessage(new Watch(_userGuardian, _systemGuardian)); _rootGuardian.SendSystemMessage(new Watch(_systemGuardian, _rootGuardian)); _eventStream.StartDefaultLoggers(_system); }
private LocalActorRef CreateRootGuardianChild(LocalActorRef rootGuardian, string name, Func<LocalActorRef> childCreator) { var cell = rootGuardian.Cell; cell.ReserveChild(name); var child = childCreator(); cell.InitChild(child); child.Start(); return child; }
private LocalActorRef CreateSystemGuardian(LocalActorRef rootGuardian, string name, LocalActorRef userGuardian) //Corresponds to Akka's: override lazy val guardian: systemGuardian { return CreateRootGuardianChild(rootGuardian, name, () => { var props = Props.Create(() => new SystemGuardianActor(userGuardian), _systemGuardianStrategy); var systemGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath/name); return systemGuardian; }); }
private LocalActorRef CreateUserGuardian(LocalActorRef rootGuardian, string name) //Corresponds to Akka's: override lazy val guardian: LocalActorRef { return CreateRootGuardianChild(rootGuardian, name, () => { var props = Props.Create<GuardianActor>(UserGuardianSupervisorStrategy); var userGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath/name); return userGuardian; }); }
private LocalActorRef CreateSystemGuardian(LocalActorRef rootGuardian, string name, LocalActorRef userGuardian) //Corresponds to Akka's: override lazy val guardian: systemGuardian { return(CreateRootGuardianChild(rootGuardian, name, () => { var props = Props.Create(() => new SystemGuardianActor(userGuardian), _systemGuardianStrategy); var systemGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath / name); return systemGuardian; })); }
protected static ActorCell NewActorCell(ActorSystem system, LocalActorRef actorRef, Props props, MessageDispatcher dispatcher, IInternalActorRef supervisor, Func<Mailbox> createMailbox) { var cell = new TestActorCell((ActorSystemImpl)system, actorRef, props, dispatcher, supervisor); cell.Init(sendSupervise: true, createMailbox: createMailbox); return cell; }
private LocalActorRef CreateSystemGuardian(LocalActorRef rootGuardian, string name, LocalActorRef userGuardian) //Corresponds to Akka's: override lazy val guardian: systemGuardian { //TODO: When SystemGuardianActor has been implemented switch to this: //return CreateRootGuardianChild(rootGuardian, name, () => //{ // var props = Props.Create(() => new SystemGuardianActor(userGuardian), _systemGuardianStrategy); // var systemGuardian = new LocalActorRef(_system, props, DefaultDispatcher, _defaultMailbox, rootGuardian, RootPath / name); // return systemGuardian; //}); return (LocalActorRef)rootGuardian.Cell.ActorOf<GuardianActor>(name); }
/// <summary> /// Initializes a new instance of the <see cref="StopChild" /> class. /// </summary> /// <param name="child">The child.</param> public StopChild(LocalActorRef child) { Child = child; }
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; }