[go: nahoru, domu]

Skip to content

Commit

Permalink
Endpoint Stop after receiving EndpointTerminatedEvent.
Browse files Browse the repository at this point in the history
  • Loading branch information
potterdai committed Feb 27, 2018
1 parent 9bd53e3 commit c2eb36a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions remote/endpoint_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ func (em *endpointManagerValue) removeEndpoint(msg *EndpointTerminatedEvent) {
em.connections.Delete(msg.Address)
ep := le.valueFunc()
ep.watcher.Tell(msg)
ep.watcher.Stop()
ep.writer.Stop()
ep.writer.Tell(msg)
}
}
}
Expand Down
1 change: 1 addition & 0 deletions remote/endpoint_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (state *endpointWatcher) Receive(ctx actor.Context) {
//Clear watcher's map
state.watched = make(map[string]*actor.PIDSet)
ctx.SetBehavior(state.Terminated)
ctx.Self().Stop()

case *remoteWatch:
//add watchee to watcher's map
Expand Down
2 changes: 2 additions & 0 deletions remote/endpoint_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ func (state *endpointWriter) Receive(ctx actor.Context) {
state.conn.Close()
case *actor.Restarting:
state.conn.Close()
case *EndpointTerminatedEvent:
ctx.Self().Stop()
case []interface{}:
state.sendEnvelopes(msg, ctx)
case actor.SystemMessage, actor.AutoReceiveMessage:
Expand Down

0 comments on commit c2eb36a

Please sign in to comment.