Skip to main content

SyncFunc

SyncFunc func type. Your implementation of this function for your cache instance is responsible for returning The new Item and what action should be taken. The sync function has no insight into your object, and needs to be told explicitly if the new item is different from the old one.

Methods


SyncFunc()

def SyncFunc(
ctx: context.Context,
batch: [Batch](../cache/batch.md?sid=flytestdlib_cache_batch)
) - > [][ItemSyncResponse](../cache/itemsyncresponse.md?sid=flytestdlib_cache_itemsyncresponse)

Your implementation of this function for your cache instance is responsible for returning The new Item and what action should be taken. The sync function has no insight into your object, and needs to be told explicitly if the new item is different from the old one.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation or deadlines.
batch[Batch](../cache/batch.md?sid=flytestdlib_cache_batch)The batch of items to be synchronized.

Returns

TypeDescription
[][ItemSyncResponse](../cache/itemsyncresponse.md?sid=flytestdlib_cache_itemsyncresponse)The updated batch of items and an error if the synchronization failed.