-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When calling arnavmq multiple times to create multiple connections to different servers, it does not actually create a new connection each time. Instead, it just replaces the configuration of the old connection.
When calling the arnavmq lib it does:
Line 50 in 452be98
| return require('./modules/arnavmq')(connection(configuration)); |
While the connection function just returns the same singleton with updated configuration:
node-arnavmq/src/modules/connection.js
Lines 95 to 106 in 452be98
| let instance; | |
| module.exports = (config) => { | |
| assert(instance || config, 'Connection can not be created because config does not exist'); | |
| assert(config.hostname); | |
| if (!instance) { | |
| instance = new Connection(config); | |
| } else { | |
| instance.config = config; | |
| } | |
| return instance; | |
| }; |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels