Documentation ¶
Overview ¶
Package namedmemcache provides a memory cache with a named lock. This is suitable for situations where creating the cached resource can be time consuming or otherwise resource hungry, or in situations where a "once only per key" is a requirement.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache holds the cached values.
func (*Cache) GetOrCreate ¶
GetOrCreate tries to get the value with the given cache key, if not found create will be called and cached. This method is thread safe. It also guarantees that the create func for a given key is invoced only once for this cache.
Click to show internal directories.
Click to hide internal directories.