Наследование: Akka.Actor.ActorCell
Пример #1
0
 public override IEnumerable <Routee> GetRoutees(RoutedActorCell routedActorCell)
 {
     if (_paths == null)
     {
         return(new Routee[0]);
     }
     return(_paths.Select(((ActorSystemImpl)routedActorCell.System).ActorSelection).Select(actor => new ActorSelectionRoutee(actor)));
 }
Пример #2
0
 public override IEnumerable <Routee> GetRoutees(RoutedActorCell routedActorCell)
 {
     for (var i = 0; i < NrOfInstances; i++)
     {
         //TODO: where do we get props?
         yield return(NewRoutee(Actor.Props.Empty, routedActorCell));
     }
 }
Пример #3
0
 protected override ActorCell NewCell()
 {
     var pool = _routerProps.RouterConfig as Pool;
     ActorCell cell = null;
     if(pool != null)
     {
         if(pool.Resizer != null)
         {
             //if there is a resizer, use ResizablePoolCell
             cell = new ResizablePoolCell(_system, this, _routerProps, _routerDispatcher, _routeeProps, _supervisor, pool);
         }
     }
     if(cell == null)
         cell = new RoutedActorCell(_system, this, _routerProps, _routerDispatcher, _routeeProps, _supervisor);
     cell.Init(sendSupervise: false, createMailbox: _createMailbox);
     return cell;
 }
Пример #4
0
 protected override ActorCell NewCell()
 {
     var pool = Props.RouterConfig as Pool;
     ActorCell cell = null;
     if (pool != null)
     {
         if (pool.Resizer != null)
         {
             cell = new ResizablePoolCell(System, this, Props, Dispatcher, _routeeProps, Supervisor, pool);
         }
     }
     if (cell == null)
     {
         cell = new RoutedActorCell(System, this, Props, Dispatcher, _routeeProps, Supervisor);
     }
     cell.Init(false, MailboxType);
     return cell;
 }
Пример #5
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <returns>TBD</returns>
        protected override ActorCell NewCell()
        {
            var       pool = Props.RouterConfig as Pool;
            ActorCell cell = null;

            if (pool != null)
            {
                if (pool.Resizer != null)
                {
                    cell = new ResizablePoolCell(System, this, Props, Dispatcher, _routeeProps, Supervisor, pool);
                }
            }
            if (cell == null)
            {
                cell = new RoutedActorCell(System, this, Props, Dispatcher, _routeeProps, Supervisor);
            }
            cell.Init(false, MailboxType);
            return(cell);
        }
Пример #6
0
        protected override ActorCell NewCell()
        {
            var       pool = _routerProps.RouterConfig as Pool;
            ActorCell cell = null;

            if (pool != null)
            {
                if (pool.Resizer != null)
                {
                    //if there is a resizer, use ResizablePoolCell
                    cell = new ResizablePoolCell(_system, this, _routerProps, _routerDispatcher, _routeeProps, _supervisor, pool);
                }
            }
            if (cell == null)
            {
                cell = new RoutedActorCell(_system, this, _routerProps, _routerDispatcher, _routeeProps, _supervisor);
            }
            cell.Init(sendSupervise: false, createMailbox: _createMailbox);
            return(cell);
        }
Пример #7
0
 public abstract IEnumerable <Routee> GetRoutees(RoutedActorCell routedActorCell);
Пример #8
0
        private static InternalActorRef LocalActorOf(ActorSystem system, Props props, InternalActorRef supervisor,
            ActorPath path, Mailbox mailbox)
        {
            ActorCell cell = null;
            if (props.RouterConfig is NoRouter || props.RouterConfig == null) //TODO: should not need nullcheck here
            {
                cell = new ActorCell(system, supervisor, props, path, mailbox);
            }
            else
            {
                var routeeProps = props.WithRouter(RouterConfig.NoRouter);
                cell = new RoutedActorCell(system, supervisor, props, routeeProps, path, mailbox);
            }

            cell.NewActor();
            //   parentContext.Watch(cell.Self);
            return cell.Self;
        }
Пример #9
0
 public override IEnumerable<Routee> GetRoutees(RoutedActorCell routedActorCell)
 {
     throw new NotImplementedException();
 }
Пример #10
0
 public abstract IEnumerable<Routee> GetRoutees(RoutedActorCell routedActorCell);
Пример #11
0
 public override IEnumerable<Routee> GetRoutees(RoutedActorCell routedActorCell)
 {
     for (int i = 0; i < NrOfInstances; i++)
     {
         //TODO: where do we get props?
         yield return NewRoutee(Akka.Actor.Props.Empty , routedActorCell);
     }
 }
Пример #12
0
 public override IEnumerable <Routee> GetRoutees(RoutedActorCell routedActorCell)
 {
     return(paths.Select(routedActorCell.System.ActorSelection).Select(actor => new ActorSelectionRoutee(actor)));
 }
Пример #13
0
 public RoutedActorRef( ActorPath path, RoutedActorCell context) : base(path, context)
 {
     this.cell = context;
 }
Пример #14
0
 public override IEnumerable <Routee> GetRoutees(RoutedActorCell routedActorCell)
 {
     throw new NotSupportedException();
 }
Пример #15
0
 public override IEnumerable<Routee> GetRoutees(RoutedActorCell routedActorCell)
 {
     return paths.Select(routedActorCell.System.ActorSelection).Select(actor => new ActorSelectionRoutee(actor));
 }
Пример #16
0
        /// <summary>
        ///     Actors the of.
        /// </summary>
        /// <param name="system">The system.</param>
        /// <param name="props">The props.</param>
        /// <param name="supervisor">The supervisor.</param>
        /// <param name="path">The path.</param>
        /// <returns>InternalActorRef.</returns>
        public override InternalActorRef ActorOf(ActorSystem system, Props props, InternalActorRef supervisor,
            ActorPath path)
        {
            ActorCell cell = null;
            Mailbox mailbox = System.Mailboxes.FromConfig(props.Mailbox);

            Deploy configDeploy = System.Provider.Deployer.Lookup(path);
            var deploy = configDeploy ?? props.Deploy ?? Deploy.None;
            if (deploy.Mailbox != null)
                props = props.WithMailbox(deploy.Mailbox);
            if (deploy.Dispatcher != null)
                props = props.WithDispatcher(deploy.Dispatcher);
            if (deploy.Scope is RemoteScope)
            {

            }

            if (string.IsNullOrEmpty(props.Mailbox))
            {
                //   throw new NotSupportedException("Mailbox can not be configured as null or empty");
            }
            if (string.IsNullOrEmpty(props.Dispatcher))
            {
                //TODO: fix this..
                //    throw new NotSupportedException("Dispatcher can not be configured as null or empty");
            }


            if (props.Deploy != null && props.Deploy.Scope is RemoteScope)
            {
                throw new NotSupportedException("LocalActorRefProvider can not deploy remote");
            }

            if (props.RouterConfig is NoRouter || props.RouterConfig == null)
            {

                props = props.WithDeploy(deploy);
                cell = new ActorCell(system, supervisor, props, path, mailbox);

            }
            else
            {
                //if no Router config value was specified, override with procedural input
                if (deploy.RouterConfig is NoRouter) 
                {
                    deploy = deploy.WithRouterConfig(props.RouterConfig);
                }

                var routerProps =
                    Props.Create<RouterActor>()
                        .WithDeploy(deploy);

                var routeeProps = props.WithRouter(RouterConfig.NoRouter);

                cell = new RoutedActorCell(system, supervisor, routerProps, routeeProps, path, mailbox);

            }
            cell.NewActor();
            //   parentContext.Watch(cell.Self);
            return cell.Self;
        }
Пример #17
0
 public RoutedActorRef(ActorPath path, RoutedActorCell context) : base(path, context)
 {
     this.cell = context;
 }