private GuardianActorRef CreateRootGuardian() { var supervisor = new RootGuardianSupervisor(_rootPath, this); var rootGuardian = new GuardianActorRef(this, ActorCreationProperties.Create(() => new Guardian()), _rootPath, CreateDefaultMailbox(), supervisor); return(rootGuardian); }
public ActorRef CreateActor(ActorCreationProperties actorCreationProperties, string name = null) { if (!_isStarted) { throw new InvalidOperationException(string.Format("You must call {0}.Start() before creating an actor.", typeof(ActorSystem).Name)); } return(_userGuardian.CreateActor(actorCreationProperties, name)); }
public ActorRef CreateActor(Type actorType, string name = null) { if (!typeof(Actor).IsAssignableFrom(actorType)) { throw new ArgumentException(string.Format("Cannot create an instance of type {0} since it is not an actor", actorType.FullName)); } var instance = CreateActor(ActorCreationProperties.Create(() => (Actor)CreateInstance(actorType))); return((ActorRef)instance); }
public ActorRef CreateActor <T>(Func <T> creator, string name = null) where T : Actor { return(CreateActor(ActorCreationProperties.Create(creator), name)); }