Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batcher ¶
type Loader ¶
type Loader[K, V, T any] interface { // CanAdd returns whether or not the key can be added to the batch without // exceeding its capacity. CanAdd(key K) bool // Add adds the key to the batch and returns a token that can be used to // retrieve the resulting value after Flush is called. Add(key K) (token T) // Flush is called only once after which no further calls to CanAdd or Add // will be made. Flush(ctx context.Context) error // Load returns the value for the given token and will only be called after // Flush if it does not return an error. Load must be safe to call // concurrently. Load(token T) (value V, err error) }
Click to show internal directories.
Click to hide internal directories.