MCPcopy Create free account
hub / github.com/RezaSi/go-interview-practice / NewThreadSafeCache

Function NewThreadSafeCache

challenge-28/solution-template.go:188–191  ·  view source on GitHub ↗

NewThreadSafeCache wraps any cache implementation to make it thread-safe

(cache Cache)

Source from the content-addressed store, hash-verified

186
187// NewThreadSafeCache wraps any cache implementation to make it thread-safe
188func NewThreadSafeCache(cache Cache) *ThreadSafeCache {
189 // TODO: Implement thread-safe wrapper constructor
190 return nil
191}
192
193func (c *ThreadSafeCache) Get(key string) (interface{}, bool) {
194 // TODO: Implement thread-safe get operation

Callers 2

TestThreadSafeCacheFunction · 0.70
TestConcurrentStressFunction · 0.70

Calls

no outgoing calls

Tested by 2

TestThreadSafeCacheFunction · 0.56
TestConcurrentStressFunction · 0.56