Use default pool, make adapter context optional

This commit is contained in:
Jon Staab
2025-03-31 09:35:48 -07:00
parent 51dd44161a
commit 4237b145ae
17 changed files with 293 additions and 290 deletions
+10
View File
@@ -19,10 +19,20 @@ export type PoolOptions = {
makeSocket?: (url: string) => Socket
}
export let poolSingleton: Pool
export class Pool {
_data = new Map<string, Socket>()
_subs: PoolSubscription[] = []
static getSingleton() {
if (!poolSingleton) {
poolSingleton = new Pool()
}
return poolSingleton
}
constructor(readonly options: PoolOptions = {}) {}
has(url: string) {