public ClusterRouterGroup(Group local, ClusterRouterGroupSettings settings)
 {
     Settings         = settings;
     Local            = local;
     Paths            = settings.AllowLocalRoutees ? settings.RouteesPaths.ToArray() : null;
     RouterDispatcher = local.RouterDispatcher;
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClusterRouterGroupActor"/> class.
        /// </summary>
        /// <param name="settings">The settings used to configure the router.</param>
        /// <exception cref="ActorInitializationException">
        /// This exception is thrown when this actor is configured as something other than a <see cref="Group"/> router.
        /// </exception>
        public ClusterRouterGroupActor(ClusterRouterGroupSettings settings) : base(settings)
        {
            Settings = settings;

            _group = Cell.RouterConfig as Group
                     ?? throw new ActorInitializationException(
                               $"ClusterRouterGroupActor can only be used with group, not {Cell.RouterConfig.GetType()}");;

            if (Settings.AllowLocalRoutees)
            {
                UsedRouteePaths = UsedRouteePaths.Add(Cluster.SelfAddress, settings.RouteesPaths.ToImmutableHashSet());
            }
        }
        public ClusterRouterGroupActor(ClusterRouterGroupSettings settings) : base(settings)
        {
            Settings = settings;
            var groupConfig = Cell.RouterConfig as Group;

            if (groupConfig != null)
            {
                _group = groupConfig;
            }
            else
            {
                throw new ActorInitializationException(string.Format("ClusterRouterGroupActor can only be used with group, not {0}", Cell.RouterConfig.GetType()));
            }
            UsedRouteePaths = Settings.AllowLocalRoutees
                ? ImmutableDictionary <Address, ImmutableHashSet <string> > .Empty.Add(Cluster.SelfAddress,
                                                                                       settings.RouteesPaths)
                : ImmutableDictionary <Address, ImmutableHashSet <string> > .Empty;
        }
示例#4
0
 internal RouterConfig Copy(Group local = null, ClusterRouterGroupSettings settings = null)
 {
     return(new ClusterRouterGroup(local ?? Local, settings ?? Settings));
 }
示例#5
0
 public ClusterRouterGroup(Group local, ClusterRouterGroupSettings settings)
     : base(settings.AllowLocalRoutees ? settings.RouteesPaths.ToArray() : Enumerable.Empty <string>(), local.RouterDispatcher)
 {
     Settings = settings;
     Local    = local;
 }
 public ClusterRouterGroup(Group local, ClusterRouterGroupSettings settings)
 {
     Settings = settings;
     Local = local;
     Paths = settings.AllowLocalRoutees ? settings.RouteesPaths.ToArray() : null;
     RouterDispatcher = local.RouterDispatcher;
 }
 public ClusterRouterGroupActor(ClusterRouterGroupSettings settings) : base(settings)
 {
     Settings = settings;
     var groupConfig = Cell.RouterConfig as Group;
     if (groupConfig != null)
     {
         _group = groupConfig;
     }
     else
     {
         throw new ActorInitializationException(string.Format("ClusterRouterGroupActor can only be used with group, not {0}", Cell.RouterConfig.GetType()));
     }
     UsedRouteePaths = Settings.AllowLocalRoutees
         ? ImmutableDictionary<Address, ImmutableHashSet<string>>.Empty.Add(Cluster.SelfAddress,
             settings.RouteesPaths)
         : ImmutableDictionary<Address, ImmutableHashSet<string>>.Empty;
 }
 public RouterConfig Copy(Group local = null, ClusterRouterGroupSettings settings = null)
 {
     return new ClusterRouterGroup(local ?? (Group)Local, settings ?? (ClusterRouterGroupSettings)Settings);
 }
 internal RouterConfig Copy(Group local = null, ClusterRouterGroupSettings settings = null)
 {
     return new ClusterRouterGroup(local ?? Local, settings ?? Settings);
 }
示例#10
0
 public ClusterRouterGroup(Group local, ClusterRouterGroupSettings settings)
     : base(settings.AllowLocalRoutees ? settings.RouteesPaths.ToArray() : Enumerable.Empty<string>(), local.RouterDispatcher)
 {
     Settings = settings;
     Local = local;
 }
示例#11
0
 public RouterConfig Copy(Group local = null, ClusterRouterGroupSettings settings = null)
 {
     return(new ClusterRouterGroup(local ?? (Group)Local, settings ?? (ClusterRouterGroupSettings)Settings));
 }