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

Can not programatically shut down middleware #30

Open
HoverBaum opened this issue Apr 12, 2016 · 2 comments
Open

Can not programatically shut down middleware #30

HoverBaum opened this issue Apr 12, 2016 · 2 comments
Labels

Comments

@HoverBaum
Copy link

For a project I want to use puer as a middleware.

To be able to test my code and expose my project as a module which can be started and stopped I need to stop the http.server that uses puer as an express middleware. However I can not seem to do this.

Here is the most basic setup for this in a repo. Running test.js it should create the server and then close it 5 seconds later. However the process keeps running.

Doing some research on the matter I found that you can actually log active handles in node so I did that with and without the puer middleware and stored the results in this gist. As can be seen here the puer middleware adds a file listener for each file in the watched folder and a timer to the stack. One of these keeps the process from exiting by still running. I am however not sure which one.

It would be awesome if the middleware would shut itself down when the http server closes or at least expose a function to clear all timers and file watcher it created.

HoverBaum added a commit to HoverBaum/puerF that referenced this issue Apr 12, 2016
Skipping the test for server and puerF as there is a bug in puer that
prevents us from shutting down the server programatically.
See leeluolee/puer#30
@leeluolee leeluolee added the bug label Apr 15, 2016
@leeluolee
Copy link
Owner

leeluolee commented Apr 15, 2016

Thanks for so detailed description, I will solve it in the weekend

@HoverBaum
Copy link
Author

Any progress on this?

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

No branches or pull requests

2 participants