-
Notifications
You must be signed in to change notification settings - Fork 321
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
Use at_exit instead of overriding trap for interrupt to shutdown ProxyServer, AuthenticatedProxyServer #176
Conversation
…Server, AuthenticatedProxyServer. Call to trap replaces handler for specified signal, so ProxyServer.shutdown would have never been called. at_exit registers handler for execution when the programm exits, handlers are executed in revers order of registration.
Hmm, I think the best solution here is to factor ProxyServer startup/shutdown into before/after blocks... |
Although this patch really makes things a bit better, it doesn't fixes same issue with example_server, and I agree with @tarcieri it's better to start/stop it with before/after blocks. |
I have re-factored how we start |
Ouch. My last commit broke your last commit :D Please, don't put before blocks into |
* upstream/master: Require proxy_server ONLY in spec that needs it Refactor ExampleServer to use before/after hook Conflicts: spec/support/example_server.rb
No worries ;) |
Typically I start and stop these sorts of things in conjunction with the tests that depend on them, rather than globally in the suite. |
Thanks for your PR, but I have implemented it in a bit different way :D |
(handshake) |
Call to trap replaces handler for specified signal,
so ProxyServer.shutdown would have never been called.
at_exit registers handler for execution when the programm
exits, handlers are executed in revers order of registration.