예제 #1
0
        public Root(IActorRegistry registry, IRootRemoteConfiguration rootConfiguration)
        {
            _registry = registry;

            if (string.IsNullOrEmpty(rootConfiguration.Adress))
            {
                _process = _registry.Add(rootConfiguration.ActorFactory, null);
            }
            else
            {
                _process = _registry.Add(rootConfiguration.ActorFactory, rootConfiguration.Adress, null);
            }
        }
예제 #2
0
        public IActorProcess SpawnChild(Func <IActor> actorFactory)
        {
            var child = _registry.Add(actorFactory, Configuration.Parent);

            _children.Add(child);

            return(child);
        }
예제 #3
0
        private Task <T> SendInternal <T>(string target, IMessage message, Future <T> future)
        {
            var targetProcess = _registry.Get(target);
            var futureProcess = _registry.Add(() => future, ActorType.Future, _process);

            targetProcess.Post(message, futureProcess);

            return(future.UnderlyingTask);
        }
예제 #4
0
 public IActorProcess Spawn(Func <IActor> actorFactory, string adress)
 {
     return(_registry.Add(actorFactory, adress, null));
 }
예제 #5
0
 public IActorProcess Spawn(Func <IActor> actorFactory, string adress)
 {
     return(_registry.Add(actorFactory, adress, ActorType.Remote, _process));
 }