Need a server.stop()
We need to have a method which:
- Closes all listeners
- terminates all client connections
- shuts down all goroutines
- returns control to the caller.
I think the right way to do this is to see the server as a service this allow the user to setup the configuration, start the it then wait for signals to gracefully shutdown the service.
I've already used this patern in a daemon I've been coding at work and it does the job.
Here is the article where I've found the patern, the explaination is great http://rcrowley.org/articles/golang-graceful-stop.html
If you agree on that I'll take care of this.
Yepp :) On Nov 5, 2014 11:53 PM, "Guillaume" [email protected] wrote:
If you agree on that I'll take care of this.
— Reply to this email directly or view it on GitHub https://github.com/alienscience/imapsrv/issues/8#issuecomment-61802450.
Short update
I'm struggling with the reader, indeed actually the when a client connected to the server it's blocked while waiting for bytes to be read. I need to find the best way to fix this, I think we should close all the connection with the client at server stop.
I hope I'll be done by the end of the week.
Hi guys I'm getting off this ticket, my laptop broke last month and my productivity got ruined with it (I can't get to code on my desktop...)
I'll be back when I can but if anyone wants to make change on this feel free