MCPcopy
hub / github.com/grafana/dskit / WatchPrefix

Method WatchPrefix

kv/memberlist/memberlist_client.go:114–121  ·  view source on GitHub ↗

WatchPrefix calls f whenever any value stored under prefix changes. Part of kv.Client interface.

(ctx context.Context, prefix string, f func(string, interface{}) bool)

Source from the content-addressed store, hash-verified

112// WatchPrefix calls f whenever any value stored under prefix changes.
113// Part of kv.Client interface.
114func (c *Client) WatchPrefix(ctx context.Context, prefix string, f func(string, interface{}) bool) {
115 err := c.awaitKVRunningOrStopping(ctx)
116 if err != nil {
117 return
118 }
119
120 c.kv.WatchPrefix(ctx, prefix, c.codec, f)
121}
122
123// We want to use KV in Running and Stopping states.
124func (c *Client) awaitKVRunningOrStopping(ctx context.Context) error {

Calls 2

WatchPrefixMethod · 0.65