soapbox-pub / nostrify

Bring your projects to life on Nostr. 🌱 This repo is a mirror of the source on GitLab.
https://nostrify.dev/
MIT License
5 stars 2 forks source link

Pools sharing relay connection? #1

Closed antonioconselheiro closed 2 months ago

antonioconselheiro commented 2 months ago

If I have two relays configured in my pool: a and b, and I enter in a profile with b and c relays in relay list, would be correct create a pool reusing existing b connection?

Reusing connections is a good practice? If it is, I would like to suggest another pools model, like NDerivatedPool and/or NExtendedPool, they should not be able to close inherited connections and reuse existing connections.

alexgleason commented 2 months ago

Reusing connections is the best practice. NPool already does this. It's not perfect, but it at least reuses the connection.

If you want a different pool behavior I suggest creating a new class that implements the NRelay interface.

antonioconselheiro commented 2 months ago

Understood