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

Method SetMultiAsync

cache/compression.go:78–85  ·  cache/compression.go::SnappyCache.SetMultiAsync

SetMultiAsync implements Cache.

(data map[string][]byte, ttl time.Duration)

Source from the content-addressed store, hash-verified

76
77// SetMultiAsync implements Cache.
78func (s *SnappyCache) SetMultiAsync(data map[string][]byte, ttl time.Duration) {
79 encoded := make(map[string][]byte, len(data))
80 for key, value := range data {
81 encoded[key] = snappy.Encode(nil, value)
82 }
83
84 s.next.SetMultiAsync(encoded, ttl)
85}
86
87func (s *SnappyCache) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error {
88 return s.next.Set(ctx, key, snappy.Encode(nil, value), ttl)

Callers

nothing calls this directly

Calls 2

EncodeMethod · 0.65
SetMultiAsyncMethod · 0.65

Tested by

no test coverage detected