Inheritance: 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);
        }
        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);
        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;
 }