Пример #1
0
        private GuardianActorRef CreateRootGuardian()
        {
            var supervisor   = new RootGuardianSupervisor(_rootPath, this);
            var rootGuardian = new GuardianActorRef(this, ActorCreationProperties.Create(() => new Guardian()), _rootPath, CreateDefaultMailbox(), supervisor);

            return(rootGuardian);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public ActorRef CreateActor <T>(Func <T> creator, string name = null) where T : Actor
 {
     return(CreateActor(ActorCreationProperties.Create(creator), name));
 }