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](batch.md?sid=flytestdlib_cache_batch)
) - > [][ItemSyncResponse](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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| batch | [Batch](batch.md?sid=flytestdlib_cache_batch) | The batch of items to be synchronized. |
Returns
| Type | Description |
|---|---|
[][ItemSyncResponse](itemsyncresponse.md?sid=flytestdlib_cache_itemsyncresponse) | The updated batch of items and an error if the synchronization failed. |