protected ClusterRouterActor(ClusterRouterSettingsBase settings) { Settings = settings; if (!(Cell.RouterConfig is Pool) && !(Cell.RouterConfig is Group)) { throw new ActorInitializationException(string.Format("Cluster router actor can only be used with Pool or Group, not with {0}", Cell.RouterConfig.GetType())); } Cluster = Cluster.Get(Context.System); Nodes = ImmutableSortedSet.Create(Member.AddressOrdering, Cluster.ReadView.Members.Where(IsAvailable).Select(x => x.Address).ToArray()); }
protected ClusterRouterActor(ClusterRouterSettingsBase settings) { Settings = settings; var routedActorCell = (RoutedActorCell)Context; if (routedActorCell == null) { throw new NotSupportedException("Current Context must be of type RouterActorContext"); } if (!(routedActorCell.RouterConfig is Pool) && !(routedActorCell.RouterConfig is Group)) { throw new NotSupportedException(string.Format("Cluster router actor can only be used with Pool or Group, now with {0}", routedActorCell.RouterConfig.GetType())); } Nodes = ImmutableSortedSet.Create(Member.AddressOrdering, Cluster.ReadView.Members.Where(IsAvailable).Select(x => x.Address).ToArray()); }
protected ClusterRouterActor(ClusterRouterSettingsBase settings) { Settings = settings; var routedActorCell = (RoutedActorCell) Context; if (routedActorCell == null) { throw new NotSupportedException("Current Context must be of type RouterActorContext"); } if(!(routedActorCell.RouterConfig is Pool) && !(routedActorCell.RouterConfig is Group)) throw new NotSupportedException(string.Format("Cluster router actor can only be used with Pool or Group, now with {0}", routedActorCell.RouterConfig.GetType())); Nodes = ImmutableSortedSet.Create(Member.AddressOrdering, Cluster.ReadView.Members.Where(IsAvailable).Select(x => x.Address).ToArray()); }