MCPcopy Create free account
hub / github.com/Super-long/ChubbyGo / Set

Method Set

BaseServer/concurrentHashMap.go:89–95  ·  view source on GitHub ↗

Sets the given value under the specified key.

(key string, value interface{})

Source from the content-addressed store, hash-verified

87
88// Sets the given value under the specified key.
89func (m ConcurrentHashMap) Set(key string, value interface{}) {
90 // Get map shard.
91 shard := m.GetShard(key)
92 shard.Lock()
93 shard.items[key] = value
94 shard.Unlock()
95}
96
97// Callback to return new element to be inserted into the map
98// It is called while lock is held, therefore it MUST NOT

Calls 1

GetShardMethod · 0.95