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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The 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
| Type | Description |
|---|---|
tuple | A tuple containing a list of batches and an error if the operation failed. |