Skip to content
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

Termination when using us_loop_integrate() #33

Closed
abrownsword opened this issue Feb 1, 2019 · 3 comments
Closed

Termination when using us_loop_integrate() #33

abrownsword opened this issue Feb 1, 2019 · 3 comments

Comments

@abrownsword
Copy link

I'm using the us_loop_integrate() function to use uWS with my own event loop, but during the exit sequence us_loop_free() calls uv_run(). This is a surprising behaviour -- should we really be re-running the event loop during exit (when stuff has already largely been torn down), especially if its not your own event loop?

@abrownsword
Copy link
Author

I’ve looked at it a bit more, and what I would like to see is a us_loop_deintegrate(), or some such function. It should do the work done by the atexit, and disable the code in the atexit. This would allow your approach of doing tear down during atexit, while allowing program architectures that prefer to avoid atexit to still shut down cleanly.

@ghost
Copy link

ghost commented Feb 2, 2019

We can work on the name but yes that could probably be added.

@ghost ghost transferred this issue from uNetworking/uWebSockets Feb 2, 2019
@ghost ghost added the enhancement label Feb 10, 2019
@ghost
Copy link

ghost commented Mar 2, 2019

This should be solved now - if you create a loop with default hint then freeing it will not run or delete it, that becomes your problem.

You also don't need to call integrate

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

No branches or pull requests

1 participant