alienscience / imapsrv

An IMAP server written in Go
BSD 3-Clause "New" or "Revised" License
48 stars 9 forks source link

Need a server.stop() #8

Open twitchyliquid64 opened 9 years ago

twitchyliquid64 commented 9 years ago

We need to have a method which:

g-dormoy commented 9 years ago

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

g-dormoy commented 9 years ago

If you agree on that I'll take care of this.

twitchyliquid64 commented 9 years ago

Yepp :) On Nov 5, 2014 11:53 PM, "Guillaume" notifications@github.com 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.

g-dormoy commented 9 years ago

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.

g-dormoy commented 9 years ago

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