diff --git a/index.d.ts b/index.d.ts index e0354c20d..3ba0ca55c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -58,6 +58,13 @@ declare namespace lmdb { **/ getMany(ids: K[], callback?: (error: any, values: V[]) => any): Promise<(V | undefined)[]> + /** + * @experimental Asynchronously get a value by id. + * @param ids + * @param callback + */ + getAsync(id: K, options?: GetOptions, callback?: (value: V) => any): Promise<(V | undefined)[]> + /** * Store the provided value, using the provided id/key * @param id The key for the entry @@ -439,6 +446,7 @@ declare namespace lmdb { filter(callback: (entry: T) => any): RangeIterable [Symbol.iterator]() : Iterator forEach(callback: (entry: T) => any): void + mapError(callback: (error: Error) => U): RangeIterable onDone?: Function asArray: T[] } diff --git a/read.js b/read.js index 01feaf4c6..0587d5501 100644 --- a/read.js +++ b/read.js @@ -818,7 +818,7 @@ export function addReadMethods( getMany(keys, callback) { // this is an asynchronous get for multiple keys. It actually works by prefetching asynchronously, - // allowing a separate to absorb the potentially largest cost: hard page faults (and disk I/O). + // allowing a separate thread/task to absorb the potentially largest cost: hard page faults (and disk I/O). // And then we just do standard sync gets (to deserialized data) to fulfil the callback/promise // once the prefetch occurs let promise = callback