MCPcopy
hub / github.com/flyteorg/flyte / NewAutoRefreshCache

Function NewAutoRefreshCache

flytestdlib/cache/in_memory_auto_refresh.go:413–416  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

411
412// Instantiates a new AutoRefresh Cache that syncs items periodically.
413func 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
419func SingleItemBatches(_ context.Context, snapshot []ItemWrapper) (batches []Batch, err error) {

Callers 1

Calls 1

Tested by 1