easternbloc / node-stomp-client

A STOMP client for Node.js
Other
93 stars 47 forks source link

Singleton of stomp-client as parameter #71

Open Cupkek05 opened 6 years ago

Cupkek05 commented 6 years ago

Hey guys, I posted my issue there https://stackoverflow.com/questions/49303927/create-a-singleton-of-stomp-client-and-pass-it-as-parameter If someone got a solution, feel free to answer me please.

I simply created a connection by const client = new Stomp(config) ; client.connect(function(sessionId, err));and tried to pass it as parameter to a manager for instance : const myManager = new MyManager(client); And use it into myManager :

function MyManager(client){
client.subscribe();
}

But I got the error "Not connected" on MyManager side.

What I did wrong ?