Use default pool, make adapter context optional
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user