improvements and fixes on pool.

This commit is contained in:
fiatjaf
2023-02-09 11:58:39 -03:00
parent 7ff97b5488
commit ff3bf4a51c
6 changed files with 182 additions and 123 deletions

View File

@@ -134,12 +134,7 @@ const pool = new SimplePool()
let relays = ['wss://relay.example.com', 'wss://relay.example2.com']
relays.forEach(async url => {
let relay = pool.ensureRelay(url)
await relay.connect()
})
let relay = pool.ensureRelay('wss://relay.example3.com')
let relay = await pool.ensureRelay('wss://relay.example3.com')
let subs = pool.sub([...relays, relay], {
authors: ['32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245']