-
Notifications
You must be signed in to change notification settings - Fork 106
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 (revisit #139) #200
Labels
Comments
Another approach for this would be to let This is the approach that Hyper uses, but with a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #139 , there's a suggestion to use
loop { server.poll() }
. However, this is much more CPU-wasteful than callingserver.run()
, and I think there are several things rouille could do to make this easier.Server::poll_timeout
. The underlying server provides therecv_timeout
method, so it would be very easy to add this: using even a small timeout means the CPU usage will be much lower than callingpoll
in a loop.Server::handle
. This would return aSend + Clone
handle which has a method to shutdown the server. This could be implemented by closing the underlying socket, triggering a wake-up, or by setting a flag and then initiating a dummy connection.The text was updated successfully, but these errors were encountered: