Instantiates a new AutoRefresh Cache that syncs items periodically.
(name string, syncCb SyncFunc, syncRateLimiter workqueue.TypedRateLimiter[*Batch], resyncPeriod time.Duration, parallelizm, size uint, scope promutils.Scope)
| 411 | |
| 412 | // Instantiates a new AutoRefresh Cache that syncs items periodically. |
| 413 | func NewAutoRefreshCache(name string, syncCb SyncFunc, syncRateLimiter workqueue.TypedRateLimiter[*Batch], resyncPeriod time.Duration, |
| 414 | parallelizm, size uint, scope promutils.Scope) (AutoRefresh, error) { |
| 415 | return NewAutoRefreshBatchedCache(name, SingleItemBatches, syncCb, syncRateLimiter, resyncPeriod, parallelizm, size, scope) |
| 416 | } |
| 417 | |
| 418 | // SingleItemBatches is a function that creates n batches of items, each with size 1 |
| 419 | func SingleItemBatches(_ context.Context, snapshot []ItemWrapper) (batches []Batch, err error) { |