-
Notifications
You must be signed in to change notification settings - Fork 28
Performance: support batch-operations on caches #10
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
When working with batches, some caches could support batch get/set/delete operations. It would probably save bandwidth / time when cachified would support these operations and fall back to parallel single operations when not supported by the cache.
export interface Cache {
name?: string;
get: (key: string) => Eventually<CacheEntry<unknown>>;
set: (key: string, value: CacheEntry<unknown>) => unknown | Promise<unknown>;
delete: (key: string) => unknown | Promise<unknown>;
batch?: {
get: (keys: string[]) => Eventually<CacheEntry<unknown>[]>;
set: (entries: { key: string, value: CacheEntry<unknown> }[]) => unknown | Promise<unknown>;
delete: (keys: string[]) => unknown | Promise<unknown>;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed