-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improved performance on pool refresh (#1579)
Signed-off-by: wadeking98 <[email protected]>
- Loading branch information
1 parent
71a525e
commit 3070120
Showing
4 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
diff --git a/build/index.d.ts b/build/index.d.ts | ||
index 880dd84215c90d7556ebca5c53f7a73050136c39..3e43fa5f05d16405e1ad6e73a66bbbe89c703b11 100644 | ||
--- a/build/index.d.ts | ||
+++ b/build/index.d.ts | ||
@@ -1,5 +1,5 @@ | ||
export { IndyVdrIndyDidRegistrar, IndyVdrIndyDidResolver, IndyVdrSovDidResolver, IndyVdrDidCreateResult, IndyVdrDidCreateOptions, } from './dids'; | ||
-export { IndyVdrPoolConfig } from './pool'; | ||
+export { IndyVdrPoolConfig, IndyVdrPoolService } from './pool'; | ||
export * from './IndyVdrModule'; | ||
export * from './IndyVdrModuleConfig'; | ||
export * from './anoncreds'; | ||
diff --git a/build/pool/IndyVdrPool.d.ts b/build/pool/IndyVdrPool.d.ts | ||
index cff86a7a020c7c6152a7c08f4ce0cb4e83b3838d..ff439c23140b5a8e9d27595ecf5f813cbca7a7a1 100644 | ||
--- a/build/pool/IndyVdrPool.d.ts | ||
+++ b/build/pool/IndyVdrPool.d.ts | ||
@@ -31,6 +31,7 @@ export declare class IndyVdrPool { | ||
get indyNamespace(): string; | ||
get config(): IndyVdrPoolConfig; | ||
connect(): void; | ||
+ public refreshConnection(): Promise<void>; | ||
private get pool(); | ||
close(): void; | ||
prepareWriteRequest<Request extends IndyVdrRequest>(agentContext: AgentContext, request: Request, signingKey: Key, endorserDid?: string): Promise<Request>; | ||
diff --git a/build/pool/IndyVdrPool.js b/build/pool/IndyVdrPool.js | ||
index 0ec57415429a0b97844b2d65a8ee83f68ad10466..56dc4c3702a0a540fda7cf1f97c2233fc5f7546c 100644 | ||
--- a/build/pool/IndyVdrPool.js | ||
+++ b/build/pool/IndyVdrPool.js | ||
@@ -25,6 +25,11 @@ class IndyVdrPool { | ||
}, | ||
}); | ||
} | ||
+ async refreshConnection() { | ||
+ if (this._pool) { | ||
+ await this.pool.refresh() | ||
+ } | ||
+ } | ||
get pool() { | ||
if (!this._pool) | ||
this.connect(); | ||
diff --git a/build/pool/IndyVdrPoolService.d.ts b/build/pool/IndyVdrPoolService.d.ts | ||
index a21dca227076c7097bea4409233bf547eb229f11..432a2dd842076776b90b0cce08e658054fd677fe 100644 | ||
--- a/build/pool/IndyVdrPoolService.d.ts | ||
+++ b/build/pool/IndyVdrPoolService.d.ts | ||
@@ -31,6 +31,7 @@ export declare class IndyVdrPoolService { | ||
}>; | ||
private getPoolForLegacyDid; | ||
private getSettledDidResponsesFromPools; | ||
+ public refreshPoolConnections(): Promise<PromiseSettledResult<void>[]>; | ||
/** | ||
* Get the most appropriate pool for the given indyNamespace | ||
*/ | ||
diff --git a/build/pool/IndyVdrPoolService.js b/build/pool/IndyVdrPoolService.js | ||
index e5abc0d40cae5a4d5777220fd0c36d85496df313..3c581926d0bd31b595e498815b730263cdd5e6ef 100644 | ||
--- a/build/pool/IndyVdrPoolService.js | ||
+++ b/build/pool/IndyVdrPoolService.js | ||
@@ -113,6 +113,12 @@ let IndyVdrPoolService = class IndyVdrPoolService { | ||
successful, | ||
}; | ||
} | ||
+ /** | ||
+ * Refresh the pool connections asynchronously | ||
+ */ | ||
+ refreshPoolConnections() { | ||
+ return Promise.allSettled(this.pools.map((pool) => pool.refreshConnection())) | ||
+ } | ||
/** | ||
* Get the most appropriate pool for the given indyNamespace | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ | |
"@aries-framework/react-hooks@^0.4.2": "patch:@aries-framework/react-hooks@npm:0.4.2#./.yarn/patches/@aries-framework-react-hooks-npm-0.4.2-84b7eb8764.patch", | ||
"@aries-framework/[email protected]": "patch:@aries-framework/react-native@npm:0.3.3#./.yarn/patches/@aries-framework-react-native-npm-0.3.3-bb75ece22d.patch", | ||
"@aries-framework/anoncreds@^0.4.0": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch", | ||
"@aries-framework/[email protected]": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch" | ||
"@aries-framework/[email protected]": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch", | ||
"@aries-framework/indy-vdr@^0.4.0": "patch:@aries-framework/indy-vdr@npm%3A0.4.0#./.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters