We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2bc412 commit c37f937Copy full SHA for c37f937
http/service.go
@@ -25,6 +25,7 @@ type Cluster interface {
25
Delete(key string) error
26
AddNode()
27
RemoveNode(addr string)
28
+ Close()
29
}
30
31
type Service struct {
store/cluster.go
@@ -114,6 +114,13 @@ func (c *Cluster) Open() {
114
115
116
117
+func (c *Cluster) Close() {
118
+ fmt.Println("Closing entire cluster..")
119
+ for _, node := range c.nodes {
120
+ node.server.GracefulStop()
121
+ }
122
+}
123
+
124
func (c *Cluster) Put(key, value string) error {
125
nodeAddr, _ := c.hashRing.GetNode(key) // get which node this key should be on
126
fmt.Printf("key = %s\t", key)
0 commit comments