Skip to main content
Module

x/databatcher/databatcher.ts>DataBatcher

DataBatcher implementation in deno
Latest
class DataBatcher
import { DataBatcher } from "https://deno.land/x/databatcher@v0.2.0/databatcher.ts";

Constructors

new
DataBatcher(
batchLoadFn: BatchLoadFn,
batchSaveFn?: BatchSaveFn | DataBatcherOptions,
options?: DataBatcherOptions,
)

Properties

private
batchLoadFn: BatchLoadFn
private
optional
batchSaveFn: BatchSaveFn
private
flushing: boolean
private
loadCache: Map<any, Promise<any>>
private
options: DataBatcherOptions
private
queue: BatchQueue

Methods

private
batchSave(batch)
private
checkSaveResult(saveResultPromise, expectedLength)
_batchLoad(batch)
_checkLoadResult(loadResultPromise, expectedLength)
_loadLater(key: any)
_saveLater(key: any, value: any)
load(key: any)
loadMany(keys: any[])
prepareBatchLoadFn(batchLoadFn: BatchLoadFn)
prepareBatchSaveFn(batchSaveFn: BatchSaveFn | DataBatcherOptions, options?: DataBatcherOptions): BatchSaveFn | null
prepareOptions(batchSaveFn: BatchSaveFn | DataBatcherOptions, options?: DataBatcherOptions)
save(key: any, value: any)
saveMany(saves: Write[])