Beispiel #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);
            }
        }
        public IActorProcess SpawnChild(Func <IActor> actorFactory)
        {
            var child = _registry.Add(actorFactory, Configuration.Parent);

            _children.Add(child);

            return(child);
        }
Beispiel #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);
        }
Beispiel #4
0
 public IActorProcess Spawn(Func <IActor> actorFactory, string adress)
 {
     return(_registry.Add(actorFactory, adress, null));
 }
Beispiel #5
0
 public IActorProcess Spawn(Func <IActor> actorFactory, string adress)
 {
     return(_registry.Add(actorFactory, adress, ActorType.Remote, _process));
 }