MCPcopy Create free account
hub / github.com/assembla/cony / Close

Method Close

client.go:100–107  ·  view source on GitHub ↗

Close shutdown the client

()

Source from the content-addressed store, hash-verified

98
99// Close shutdown the client
100func (c *Client) Close() {
101 atomic.StoreInt32(&c.run, noRun) // c.run = false
102 conn, _ := c.conn.Load().(*amqp.Connection)
103 if conn != nil {
104 conn.Close()
105 }
106 c.conn.Store((*amqp.Connection)(nil))
107}
108
109// Loop should be run as condition for `for` with receiving from (*Client).Errors()
110//

Callers 3

ExampleFunction · 0.95
ExampleClient_LoopFunction · 0.95
TestClient_CloseFunction · 0.95

Calls 1

CloseMethod · 0.65

Tested by 3

ExampleFunction · 0.76
ExampleClient_LoopFunction · 0.76
TestClient_CloseFunction · 0.76