Share websocket connection
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Hi there,
I am currently using bcoin in a large scale application and now looking into this wallet rewrite. I am concerned about watching thousands of wallet and the performances problems of having thousands of web sockets connection on the same process.
It seems like the bcurl’s client is not bound to a specific wallet, so we don’t need to have one instance for every wallet (today by inheritance). Instead, we could share one instance, so it also share the web socket connection in same process.
This way, each wallet ask client to register to a wallet id, then the client will receive events for every wallets. It could re-dispatch these events with wallet id in name of event, so each wallet only get event that is is destined to.
`socket.on(‘wallet tx’)` => `this.emit('wallet:walletId tx’)`
Do you think this is envisageable ?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the bcurl client and the wallet client inheritance described in the issue, then trace how websocket connections and wallet events are registered. Done would mean evaluating or implementing one shared connection for the process and routing each received event to the wallet identified by its wallet id; the issue does not name files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100