MCPcopy Create free account
hub / github.com/dadgar/onecache / Exit

Method Exit

onecache/onecache.go:186–214  ·  view source on GitHub ↗

Exit removes this Node from the ring, kills background tasks and frees any used resources. Once this is called the Node will no longer accept connections and can not be used.

()

Source from the content-addressed store, hash-verified

184// used resources. Once this is called the Node will no longer accept
185// connections and can not be used.
186func (n *Node) Exit() error {
187 close(n.quitCh)
188 n.replicator.Stop()
189
190 // Clean up the datastore.
191 if err := n.data.Destroy(); err != nil {
192 return err
193 }
194
195 // Close the listener and RPC Server.
196 n.shutdown = true
197 if err := n.listener.Close(); err != nil {
198 return err
199 }
200
201 if err := n.server.shutdown(); err != nil {
202 return err
203 }
204
205 if err := n.serf.Leave(); err != nil {
206 return err
207 }
208
209 if err := n.serf.Shutdown(); err != nil {
210 return err
211 }
212
213 return nil
214}
215
216// Join adds this Node to an existing set ring. Nodes is a list of ip:port port pairs
217// or DNS addresses.

Callers 4

mainFunction · 0.80
TestExitFunction · 0.80
tearDownNodesFunction · 0.80

Calls 5

DestroyMethod · 0.80
shutdownMethod · 0.80
ShutdownMethod · 0.80
StopMethod · 0.65
CloseMethod · 0.45

Tested by 2

TestExitFunction · 0.64