nodegin / tglib

TDLib (Telegram Database library) bindings for Node.js
114 stars 16 forks source link

How to exit? #53

Closed omgitsraven closed 4 years ago

omgitsraven commented 4 years ago

Once you're connected, is there any way for the script to decide when to close itself, or is the only option for the user to manually ctrl-C?

omgitsraven commented 4 years ago

I just realised that process.exit() works, so maybe not exiting implicitly doesn't really matter that much...

omgitsraven commented 4 years ago

Hmm -- I just noticed client._destroy() in the readme, but calling that still doesn't let the program explicitly exit?

omgitsraven commented 4 years ago

...I take it back; client._destroy() just takes several seconds to complete. Never mind then :)

So yeah, for anyone else in my shoes, the 'clean' but slow way is client._destroy(), and the immediate way is process.exit().