Documentation
¶
Overview ¶
Package cache provides an in-memory cache for aggregate and process instances.
Index ¶
Constants ¶
View Source
const DefaultTTL = 1 * time.Hour
DefaultTTL is the default *minimum* period of time to keep cache records in memory after they were last used.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// TTL is the *minimum* period of time to keep cache records in memory after
// they were last used. If it is non-positive, DefaultTTL is used.
TTL time.Duration
// Logger is the target for log messages about modifications to the cache.
Logger logging.Logger
// contains filtered or unexported fields
}
Cache is an in-memory cache for storing aggregate and process instances for a single handler.
func (*Cache) Acquire ¶
Acquire locks and returns the cache record with the given ID, and ties its lifetime to w.
The lock on the record is automatically released when w is completed. The record is removed from the cache if w fails.
If the record has already been acquired, it blocks until the record is released or ctx is canceled.
Click to show internal directories.
Click to hide internal directories.