NewAutoRefreshBatchedCache
Instantiates a new AutoRefresh Cache that syncs items in batches.
def NewAutoRefreshBatchedCache(
name: string,
createBatches: CreateBatchesFunc,
syncCb: SyncFunc,
syncRateLimiter: workqueue.TypedRateLimiter[*Batch],
resyncPeriod: time.Duration,
parallelizm: int,
size: int,
scope: promutils.Scope
) - > AutoRefresh, error
Instantiates a new AutoRefresh Cache that syncs items in batches.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The name of the cache, used for identification and metrics. |
| createBatches | CreateBatchesFunc | A function that defines how to create batches of items for synchronization. |
| syncCb | SyncFunc | A callback function executed to synchronize a batch of items. |
| syncRateLimiter | workqueue.TypedRateLimiter[*Batch] | A rate limiter to control the frequency of synchronization operations for batches. |
| resyncPeriod | time.Duration | The duration after which the cache will perform a full resynchronization. |
| parallelizm | int | The number of concurrent synchronization operations allowed. |
| size | int | The maximum number of items the cache can hold. |
| scope | promutils.Scope | The Prometheus scope for metrics collection related to this cache. |
Returns
| Type | Description |
|---|---|
AutoRefresh, error | A new AutoRefresh instance and an error if the instantiation fails. |