tryretool / retoolrpc

MIT License
6 stars 5 forks source link

fix: use `unref()` to allow graceful shutdown #26

Closed KATT closed 8 months ago

KATT commented 8 months ago

Closes #23 but an explicit stop would still be nice along side this

When called, the active Timeout object will not require the Node.js event loop to remain active. If there is no other activity keeping the event loop running, the process may exit before the Timeout object's callback is invoked. Calling timeout.unref() multiple times will have no effect.

https://nodejs.org/api/timers.html#timeoutunref