Skip to content

Commit ea79715

Browse files
committed
.
1 parent 9cf28e8 commit ea79715

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

cluster/identitylookup/disthash/placement_actor.go

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func (p *placementActor) Receive(ctx actor.Context) {
4848

4949
func (p *placementActor) onTerminated(msg *actor.Terminated) {
5050
found, key, meta := p.pidToMeta(msg.Who)
51+
clusterKind := p.cluster.GetClusterKind(meta.ID.Kind)
52+
clusterKind.Dec()
5153

5254
activationTerminated := &clustering.ActivationTerminated{
5355
Pid: msg.Who,
@@ -98,6 +100,7 @@ func (p *placementActor) onActivationRequest(msg *clustering.ActivationRequest,
98100
props := clustering.WithClusterIdentity(clusterKind.Props, msg.ClusterIdentity)
99101

100102
pid := ctx.SpawnPrefix(props, msg.ClusterIdentity.Identity)
103+
clusterKind.Inc()
101104

102105
p.actors[key] = GrainMeta{
103106
ID: msg.ClusterIdentity,

cluster/kind.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ func (ak *ActivatedKind) Inc() {
5252
atomic.AddInt32(&ak.count, 1)
5353
}
5454

55-
func (ak *ActivatedKind) Dev() {
55+
func (ak *ActivatedKind) Dec() {
5656
atomic.AddInt32(&ak.count, -1)
5757
}

examples/cluster-gossip/node1/main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ func startNode() *cluster.Cluster {
4949

5050
as := &cluster.ActorStatistics{}
5151

52+
fmt.Printf("Member %v\n", msg.MemberID)
5253
if unpackErr := msg.Value.UnmarshalTo(as); unpackErr != nil {
53-
fmt.Printf("\nActorStatistics %v\n\n", as)
54+
//loop over as.ActorCount map
55+
for k, v := range as.ActorCount {
56+
fmt.Printf("ActorCount %v %v\n", k, v)
57+
}
58+
5459
}
5560
}
5661
})

0 commit comments

Comments
 (0)