Skip to content

add autoUnref option to Manager. #1442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

KCErb
Copy link

@KCErb KCErb commented Feb 8, 2021

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behaviour

If a client app is trying to reconnect, it leaves a refd timer on the event loop which will prevent the program from exiting.

New behaviour

With this change, if a user passes autoUnref: true the reconnect timer gets unrefd each time it is created so that if it would have been the only thing preventing the event loop from exiting, the program exits.

Other information (e.g. related issues)

This coordinates well with (but is in a sense independent of) this PR on engine.io-client:
socketio/engine.io-client#652

Please note the ref and unref API mentioned there which is available on other Node internals such as timers, sockets, and servers.

@darrachequesne
Copy link
Member

Merged as 6abfa1f and included in [email protected]. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants