/// <summary> /// Need to subscribe to cluster changes /// </summary> protected override void PreStart() { Cluster = Cluster.Get(Context.System); // subscribe to IMemberEvent and UnreachableMember events Cluster.Subscribe(Self, ClusterEvent.InitialStateAsEvents, new[] { typeof(ClusterEvent.IMemberEvent), typeof(ClusterEvent.UnreachableMember) }); }
public TransformationBackend() { Log = Logging.GetLogger(Context.System, this); Cluster = Akka.Cluster.Cluster.Get(Context.System); }
/// <summary> /// User overridable callback. /// <p/> /// Is called when an Actor is started. /// Actors are automatically started asynchronously when created. /// Empty default implementation. /// </summary> protected override void PreStart() { this.cluster = Cluster.Get(Context.System); }
/// <summary> /// Need to subscribe to cluster changes /// </summary> protected override void PreStart() { this.cluster = Cluster.Get(Context.System); this.cluster.Subscribe( this.Self, ClusterEvent.InitialStateAsEvents, new[] { typeof(ClusterEvent.IMemberEvent), typeof(ClusterEvent.UnreachableMember) }); this.cluster.RegisterOnMemberUp(() => { Context.GetLogger().Info("{Address}: I am up", this.cluster.SelfAddress.Port); }); }
/// <summary> /// This constructor is used when creating an instance from configured fully-qualified name /// </summary> public PerformanceCounterMetricsCollector(ActorSystem system) : this(Cluster.Get(system)) { }
private PerformanceCounterMetricsCollector(Cluster cluster) : this(cluster.SelfAddress, EWMA.CalculateAlpha(cluster.Settings.MetricsMovingAverageHalfLife, cluster.Settings.MetricsInterval)) { }