MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / OnStop

Method OnStop

p2p/switch.go:247–260  ·  view source on GitHub ↗

OnStop implements BaseService. It stops all peers and reactors.

()

Source from the content-addressed store, hash-verified

245
246// OnStop implements BaseService. It stops all peers and reactors.
247func (sw *Switch) OnStop() {
248 // Stop peers
249 for _, p := range sw.peers.List() {
250 sw.stopAndRemovePeer(p, nil)
251 }
252
253 // Stop reactors
254 sw.Logger.Debug("Switch: Stopping reactors")
255 for _, reactor := range sw.reactors {
256 if err := reactor.Stop(); err != nil {
257 sw.Logger.Error("error while stopped reactor", "reactor", reactor, "error", err)
258 }
259 }
260}
261
262//---------------------------------------------------------------------
263// Peers

Callers

nothing calls this directly

Calls 5

stopAndRemovePeerMethod · 0.95
ListMethod · 0.65
DebugMethod · 0.65
StopMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected