From 9d21572067d35dcd37735f8b5d9df7f9d159be11 Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Wed, 27 Sep 2023 12:23:31 -0400 Subject: [PATCH] Add getMultiWithErrors --- lib/memjs/memjs.d.ts | 10 +++++++ lib/memjs/memjs.d.ts.map | 2 +- lib/memjs/memjs.js | 36 ++++++++++++++++++++++++- src/memjs/memjs.ts | 57 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 2 deletions(-) diff --git a/lib/memjs/memjs.d.ts b/lib/memjs/memjs.d.ts index 7d14614..90d55c3 100644 --- a/lib/memjs/memjs.d.ts +++ b/lib/memjs/memjs.d.ts @@ -36,6 +36,15 @@ export interface GetResult { export declare type GetMultiResult = { [K in Keys]?: GetResult; }; +export interface GetMultiError { + error: Error; + serverKey: string; + keys: Keys[]; +} +export interface GetMultiWithErrorsResult { + result: GetMultiResult; + errors: GetMultiError[]; +} declare class Client { servers: Server[]; seq: number; @@ -126,6 +135,7 @@ declare class Client { * requested keys to results, or null if the key was not found. */ getMulti(keys: Keys[]): Promise>; + getMultiWithErrors(keys: Keys[]): Promise>; /** * Sets `key` to `value`. */ diff --git a/lib/memjs/memjs.d.ts.map b/lib/memjs/memjs.d.ts.map index eba3c23..11015ca 100644 --- a/lib/memjs/memjs.d.ts.map +++ b/lib/memjs/memjs.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"memjs.d.ts","sourceRoot":"","sources":["../../src/memjs/memjs.ts"],"names":[],"mappings":";AAEA,OAAO,EAGL,MAAM,EACN,aAAa,EACd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAkB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAOL,WAAW,EACX,OAAO,EACR,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,iBAAS,8BAA8B,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB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AAM,EACX,QAAQ,EAAE,uBAAuB,EACjC,OAAO,GAAE,MAAU;IA0CrB,OAAO;IASP,OAAO,CAAC,iBAAiB;IAWzB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAW5B;AAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/memjs/memjs.js b/lib/memjs/memjs.js index f94461e..e95376c 100644 --- a/lib/memjs/memjs.js +++ b/lib/memjs/memjs.js @@ -248,6 +248,40 @@ class Client { })); return Object.assign({}, ...results); } + async getMultiWithErrors(keys) { + const serverKeytoLookupKeys = {}; + keys.forEach((lookupKey) => { + const serverKey = this.lookupKeyToServerKey(lookupKey); + if (!serverKeytoLookupKeys[serverKey]) { + serverKeytoLookupKeys[serverKey] = []; + } + serverKeytoLookupKeys[serverKey].push(lookupKey); + }); + const usedServerKeys = Object.keys(serverKeytoLookupKeys); + const errors = []; + const results = await Promise.all(usedServerKeys.map(async (serverKey) => { + const server = this.serverKeyToServer(serverKey); + try { + return await this._getMultiToServer(server, serverKeytoLookupKeys[serverKey]); + } + catch (err) { + let error; + if (err instanceof Error) { + error = err; + } + else { + error = new Error("Unknown Error"); + error.thrown = err; + } + errors.push({ + error, + serverKey, + keys: serverKeytoLookupKeys[serverKey] + }); + } + })); + return { result: Object.assign({}, ...results), errors }; + } /** * Sets `key` to `value`. */ @@ -742,4 +776,4 @@ class Client { } } exports.Client = Client; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVtanMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbWVtanMvbWVtanMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUF3Qjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUV4QixxQ0FLa0I7QUEyaUNELHVGQTdpQ2YsZUFBTSxPQTZpQ2U7QUExaUN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yLmpzXG4gICAgICAgICAgICAgIC8vIFRoaXMgaXNuJ3QgdGVjaG5pY2FsbHkgbmVlZGVkIGhlcmUgYmVjYXVzZSB0aGUgbG9naWMgaW4gc2VydmVyLmpzIGFsc28gY2hlY2tzIGlmIHRvdGFsQm9keUxlbmd0aCA9PT0gMCwgYnV0IG91ciB1bml0dGVzdHMgYXJlbid0IGdyZWF0IGFib3V0IHNldHRpbmcgdGhhdCBmaWVsZCwgYW5kIGFsc28gdGhpcyBtYWtlcyBpdCBtb3JlIGV4cGxpY2l0XG4gICAgICAgICAgICAgIGhhbmRsZS5xdWlldCA9IGZhbHNlO1xuICAgICAgICAgICAgICByZXNvbHZlKHJlc3BvbnNlTWFwKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgIHJlc3BvbnNlLmhlYWRlci5vcGNvZGUgPT09IGNvbnN0YW50cy5PUF9HRVRLIHx8XG4gICAgICAgICAgICAgIHJlc3BvbnNlLmhlYWRlci5vcGNvZGUgPT09IGNvbnN0YW50cy5PUF9HRVRLUVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGRlc2VyaWFsaXplZCA9IHRoaXMuc2VyaWFsaXplci5kZXNlcmlhbGl6ZShcbiAgICAgICAgICAgICAgICByZXNwb25zZS5oZWFkZXIub3Bjb2RlLFxuICAgICAgICAgICAgICAgIHJlc3BvbnNlLnZhbCxcbiAgICAgICAgICAgICAgICByZXNwb25zZS5leHRyYXNcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgY29uc3Qga2V5ID0gcmVzcG9uc2Uua2V5LnRvU3RyaW5nKCk7XG4gICAgICAgICAgICAgIGlmIChrZXkubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChcbiAgICAgICAgICAgICAgICAgIG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgXCJSZWNpZXZlZCBlbXB0eSBrZXkgaW4gZ2V0TXVsdGk6IFwiICtcbiAgICAgICAgICAgICAgICAgICAgICBKU09OLnN0cmluZ2lmeShyZXNwb25zZSlcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJlc3BvbnNlTWFwW2tleV0gPSB7IC4uLmRlc2VyaWFsaXplZCwgY2FzOiByZXNwb25zZS5oZWFkZXIuY2FzIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KFxuICAgICAgICAgICAgICAgIG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgIFwiUmVjaWV2ZWQgcmVzcG9uc2UgaW4gZ2V0TXVsdGkgZm9yIHVua25vd24gb3Bjb2RlOiBcIiArXG4gICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4gcmVqZWN0KFxuICAgICAgICAgICAgICB0aGlzLmNyZWF0ZUFuZExvZ0Vycm9yKFwiR0VUXCIsIHJlc3BvbnNlLmhlYWRlci5zdGF0dXMpXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgLy8gVGhpcyBwcmV2ZW50cyB0aGUgaGFuZGxlciBmcm9tIGJlaW5nIGRlbGV0ZWRcbiAgICAgIC8vIGFmdGVyIHRoZSBmaXJzdCByZXNwb25zZS4gTG9naWMgaW4gc2VydmVyLmpzLlxuICAgICAgaGFuZGxlLnF1aWV0ID0gdHJ1ZTtcblxuICAgICAgY29uc3Qgc2VxID0gdGhpcy5pbmNyU2VxKCk7XG4gICAgICBjb25zdCByZXF1ZXN0ID0gdGhpcy5fYnVpbGRHZXRNdWx0aVJlcXVlc3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c1xuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICBjb25zdCBrZXkgPSByZXNwb25zZS5rZXkudG9TdHJpbmcoKTtcbiAgICAgICAgICAgICAgaWYgKGtleS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KFxuICAgICAgICAgICAgICAgICAgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICBcIlJlY2lldmVkIGVtcHR5IGtleSBpbiBnZXRNdWx0aTogXCIgK1xuICAgICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcmVzcG9uc2VNYXBba2V5XSA9IHsgLi4uZGVzZXJpYWxpemVkLCBjYXM6IHJlc3BvbnNlLmhlYWRlci5jYXMgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3QoXG4gICAgICAgICAgICAgICAgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgXCJSZWNpZXZlZCByZXNwb25zZSBpbiBnZXRNdWx0aSBmb3IgdW5rbm93biBvcGNvZGU6IFwiICtcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5zdHJpbmdpZnkocmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiByZWplY3QoXG4gICAgICAgICAgICAgIHRoaXMuY3JlYXRlQW5kTG9nRXJyb3IoXCJHRVRcIiwgcmVzcG9uc2UuaGVhZGVyLnN0YXR1cylcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICAvLyBUaGlzIHByZXZlbnRzIHRoZSBoYW5kbGVyI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k7XG4gICAgICBpZiAoIXNlcnZlcktleXRvTG9va3VwS2V5c1tzZXJ2ZXJLZXldKSB7XG4gICAgICAgIHNlcnZlcktleXRvTG9va3VwS2V5c1tzZXJ2ZXJLZXldID0gW107XG4gICAgICB9XG4gICAgICBzZXJ2ZXJLZXl0b0xvb2t1cEtleXNbc2VydmVyS2V5XS5wdXNoKGxvb2t1cEtleSk7XG4gICAgfSk7XG5cbiAgICBjb25zdCB1c2VkU2VydmVyS2V5cyA9IE9iamVjdC5rZXlzKHNlcnZlcktleXRvTG9va3VwS2V5cyk7XG4gICAgY29uc3QgZXJyb3JzOiBHZXRNdWx0aUVycm9yPEtleXM+W10gPSBbXTtcbiAgICBjb25zdCByZXN1bHRzID0gYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICB1c2VkU2VydmVyS2V5cy5tYXAoYXN5bmMgKHNlcnZlcktleSkgPT4ge1xuICAgICAgICBjb25zdCBzZXJ2ZXIgPSB0aGlzLnNlcnZlcktleVRvU2VydmVyKHNlcnZlcktleSk7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMuX2dldE11bHRpVG9TZXJ2ZXIoc2VydmVyLCBzZXJ2ZXJLZXl0b0xvb2t1cEtleXNbc2VydmVyS2V5XSk7XG4gICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgIGxldCBlcnJvcjogRXJyb3I7XG4gICAgICAgICAgaWYgKGVyciBpbnN0YW5jZW9mIEVycm9yKSB7XG4gICAgICAgICAgICBlcnJvciA9IGVycjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXJyb3IgPSBuZXcgRXJyb3IoXCJVbmtub3duIEVycm9yXCIpO1xuICAgICAgICAgICAgKGVycm9yIGFzIGFueSkudGhyb3duID0gZXJyO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICAgIGVycm9yLFxuICAgICAgICAgICAgc2Vyd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ogUmVzcG9uc2VTdGF0dXMgfCB1bmRlZmluZWRcbiAgKTogRXJyb3Ige1xuICAgIGNvbnN0IGVycm9yTWVzc2FnZSA9IGBNZW1KUyAke2NvbW1hbmROYW1lfTogJHtjb25zdGFudHMucmVzcG9uc2VTdGF0dXNUb1N0cmluZyhcbiAgICAgIHJlc3BvbnNlU3RhdHVzXG4gICAgKX1gO1xuICAgIHRoaXMub3B0aW9ucy5sb2dnZXIubG9nKGVycm9yTWVzc2FnZSk7XG4gICAgcmV0dXJuIG5ldyBFcnJvcihlcnJvck1lc3NhZ2UpO1xuICB9XG5cbiAgLyoqXG4gICAqIExvZyBhbiBlcnJvciB0byB0aGUgbG9nZ2VyLCB0aGVuIHJldHVybiB0aGUgZXJyb3IuXG4gICAqIElmIGEgY2FsbGJhY2sgaXMgZ2l2ZW4sIGNhbGwgaXQgd2l0aCBjYWxsYmFjayhlcnJvciwgbnVsbCkuXG4gICAqL1xuICBwcml2YXRlIGhhbmRsZVJlc3BvbnNlRXJyb3IoXG4gICAgY29tbWFuZE5hbWU6IHN0cmluZyxcbiAgICByZXNwb25zZVN0YXR1czogUmVzcG9uc2VTdGF0dXMgfCB1bmRlZmluZWQsXG4gICAgY2FsbGJhY2s6IHVuZGVmaW5lZCB8ICgoZXJyb3I6IEVycm9yIHwgbnVsbCwgb3RoZXI6IG51bGwpID0+IHZvaWQpXG4gICk6IEVycm9yIHtcbiAgICBjb25zdCBlcnJvciA9IHRoaXMuY3JlYXRlQW5kTG9nRXJyb3IoY29tbWFuZE5hbWUsIHJlc3BvbnNlU3RhdHVzKTtcbiAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgIGNhbGxiYWNrKGVycm9yLCBudWxsKTtcbiAgICB9XG4gICAgcmV0dXJuIGVycm9yO1xuICB9XG59XG5cbmV4cG9ydCB7IENsaWVudCwgU2VydmVyLCBVdGlscywgSGVhZGVyIH07XG4iXX0= \ No newline at end of file diff --git a/src/memjs/memjs.ts b/src/memjs/memjs.ts index a14915a..66bbeaa 100644 --- a/src/memjs/memjs.ts +++ b/src/memjs/memjs.ts @@ -97,6 +97,21 @@ export type GetMultiResult< [K in Keys]?: GetResult; }; +export interface GetMultiError { + error: Error; + serverKey: string; + keys: Keys[]; +} + +export interface GetMultiWithErrorsResult< +Keys extends string = string, +Value = MaybeBuffer, +Extras = MaybeBuffer +> { + result: GetMultiResult; + errors: GetMultiError[]; +} + class Client { servers: Server[]; seq: number; @@ -384,6 +399,48 @@ class Client { return Object.assign({}, ...results); } + async getMultiWithErrors( + keys: Keys[] + ): Promise> { + const serverKeytoLookupKeys: { + [serverKey: string]: Keys[]; + } = {}; + keys.forEach((lookupKey) => { + const serverKey = this.lookupKeyToServerKey(lookupKey); + if (!serverKeytoLookupKeys[serverKey]) { + serverKeytoLookupKeys[serverKey] = []; + } + serverKeytoLookupKeys[serverKey].push(lookupKey); + }); + + const usedServerKeys = Object.keys(serverKeytoLookupKeys); + const errors: GetMultiError[] = []; + const results = await Promise.all( + usedServerKeys.map(async (serverKey) => { + const server = this.serverKeyToServer(serverKey); + try { + return await this._getMultiToServer(server, serverKeytoLookupKeys[serverKey]); + } catch (err) { + let error: Error; + if (err instanceof Error) { + error = err; + } else { + error = new Error("Unknown Error"); + (error as any).thrown = err; + } + + errors.push({ + error, + serverKey, + keys: serverKeytoLookupKeys[serverKey] + }); + } + }) + ); + + return { result: Object.assign({}, ...results), errors }; + } + /** * Sets `key` to `value`. */