Skip to content

Instantly share code, notes, and snippets.

@anandkunal
Created September 17, 2014 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandkunal/e61a10c1cd071a07af13 to your computer and use it in GitHub Desktop.
Save anandkunal/e61a10c1cd071a07af13 to your computer and use it in GitHub Desktop.
func (r *RPC) Put(item *CacheItem, ack *bool) error {
r.mu.Lock()
defer r.mu.Unlock()
r.cache[item.Key] = item.Value
*ack = true
r.requests.Put++
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment