Documentation ¶
Overview ¶
Atomic value with validity timeout. "modified" timestamp is updated after value, without consistency. Usage scenario examples: DNS resolve, sensor reading. All methods except `Init` are thread-safe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
func (*Int32) GetFresh ¶
Returns current value and true if it's fresh. Costs current timestamp lookup.
func (*Int32) GetOrUpdate ¶
Always returns fresh value. If value is stale, runs `f()`. It is `f()` responsibility to update value with `Set()` method. No cache stampede guard. May return value from concurrent `GetOrUpdate` or `Set`. Costs current timestamp lookup.
Click to show internal directories.
Click to hide internal directories.