コード例 #1
0
 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());
            }
        }
コード例 #3
0
        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;
 }
コード例 #6
0
 public ClusterRouterGroup(Group local, ClusterRouterGroupSettings settings)
 {
     Settings = settings;
     Local = local;
     Paths = settings.AllowLocalRoutees ? settings.RouteesPaths.ToArray() : null;
     RouterDispatcher = local.RouterDispatcher;
 }
コード例 #7
0
 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;
 }
コード例 #8
0
 public RouterConfig Copy(Group local = null, ClusterRouterGroupSettings settings = null)
 {
     return new ClusterRouterGroup(local ?? (Group)Local, settings ?? (ClusterRouterGroupSettings)Settings);
 }
コード例 #9
0
 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));
 }