Skip to main content

CreateBatchesFunc

CreateBatchesFunc is a func type. Your implementation of this function for your cache instance is responsible for subdividing the list of cache items into batches.

Methods


CreateBatchesFunc()

def CreateBatchesFunc(
ctx: context.Context,
snapshot: [][ItemWrapper](itemwrapper.md?sid=flytestdlib_cache_itemwrapper)
) - > tuple

Subdivides the list of cache items into batches. Your implementation of this function for your cache instance is responsible for subdividing the list of cache items into batches.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for cancellation and deadlines.
snapshot[][ItemWrapper](itemwrapper.md?sid=flytestdlib_cache_itemwrapper)A slice of ItemWrapper objects representing the current state of the cache items to be batched.

Returns

TypeDescription
tupleA tuple containing a list of batches and an error if the operation failed.