RocketChat / Rocket.Chat.js.SDK

Utility for apps and bots to interact with Rocket.Chat via DDP and/or API
MIT License
136 stars 94 forks source link

Is this SDK thread safe? #164

Open genglinxiao opened 10 months ago

genglinxiao commented 10 months ago

I imagine someone had run into this already, but didn't find anything yet. I'm trying to write a bot using this SDK and wondering is it possible to handle multiple thread to better handle concurrent conversations. I would like to be able to register callback function for different person in different thread, for example, these 2 functions below:

await driver.subscribeToMessages();
await driver.reactToMessages(processMessages);

Is it OK to run them in dedicated threads? Or are there better ways?