Skip to content

Commit

Permalink
include method to list current pool relays connections and to close a…
Browse files Browse the repository at this point in the history
…ll connections
  • Loading branch information
antonioconselheiro committed Jul 17, 2024
1 parent 43688e0 commit f461944
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions abstract-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,17 @@ export class AbstractSimplePool {
return r.publish(event)
})
}

listConnectionStatus(): Map<string, boolean> {
const map = new Map<string, boolean>()
this.relays
.forEach((relay, url) => map.set(url, relay.connected))

return map
}

destroy(): void {
this.relays.forEach(conn => conn.close())
this.relays = new Map()
}
}

0 comments on commit f461944

Please sign in to comment.