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

Stopping the server while starting it #2736

Closed
kanongil opened this issue Aug 25, 2015 · 4 comments
Closed

Stopping the server while starting it #2736

kanongil opened this issue Aug 25, 2015 · 4 comments
Assignees
Milestone

Comments

@kanongil
Copy link
Contributor

@kanongil kanongil commented Aug 25, 2015

I would like to be able to call server.stop() even while it is starting. Currently, it will throw when I try to do this, with no practical way of telling before making the actual call.

The use case is simple: I want to install a SIGINT handler that gracefully stops the server. If it triggers while starting the server, I would like it to abort the start process, and apply the stop process as usual, before calling the server.start() callback with an error.

Note that it should also work if stopped while in the implicit initializing state.

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Aug 25, 2015

Can't abort the start process fully. Can try in between callbacks.

@kanongil
Copy link
Contributor Author

@kanongil kanongil commented Aug 26, 2015

@hueniverse That was the idea. I guess it would also work if the stop is deferred until the start is completely finished.

@kanongil
Copy link
Contributor Author

@kanongil kanongil commented Aug 31, 2015

Ok, I decided to create an addon to handle my use case, making this request somewhat redundant. See https://github.com/kanongil/exiting if you are interested.

@hueniverse hueniverse added bug and removed request labels Oct 2, 2015
@hueniverse hueniverse added this to the 10.2.0 milestone Oct 2, 2015
@hueniverse hueniverse self-assigned this Oct 2, 2015
@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Oct 2, 2015

Changed the assertion to a callback error. While this is a breaking change, it should not cause issues as existing code should already be handling errors on the callback.

@hueniverse hueniverse closed this in 6120f43 Oct 2, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants