Hi @valyala
In Go 1.8, net/http is having graceful shutdown feature. Server.Shutdown
It would be nice if it is implemented in fasthttp too.
I'm facing the same issue can we have method to shutdown fasthttp, or ListenAndServe could return the listner object as net/http. We are blocked on this.
I would like to second this. An ability to gracefully shutdown the server would be great. I'm working on a program that could greatly benefit from this.
I would be willing to work on a pull request to enable this, however I would feel more comfortable doing that after some discussion. @valyala and everyone who wants this, should this feature work similar to how net/http accomplishes this in 1.8? Or would that not fit well into this project's codebase? If not, lets discuss a good API design for shutting down servers.
Hi guys, looks like solution already exists: https://github.com/valyala/fasthttp/issues/66
@valyala I think there is a legitimate need for this instead of people having to write custom listener.
+1
+1
+1
+1
+1
On Thu, Nov 23, 2017 at 5:06 PM, funlake notifications@github.com wrote:
+1
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/valyala/fasthttp/issues/233#issuecomment-346562475,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAC55hpRgtKgWoiEGIgKb62RE3ecPK1Bks5s5TWHgaJpZM4MFz0S
.
--
Simple forum in golang https://www.youbbs.org
+1
It would be really nice since Cntrl+C is archaic!
+1
+1
+1
+1
+1
+1
+1
Here is an example I wrote. Feedback wanted and welcome:
https://github.com/dstroot/fasthttp-graceful-shutdown
+1
+1
Because of popular demand I have just added a Server.Shutdown() function to my active fork of fasthttp: https://github.com/erikdubbelboer/fasthttp
@erikdubbelboer That's exciting! Deserves a new tag IMO.
Is it a deliberate decision to not take cancellation context?
@illotum I just tagged v1.1.0.
Nothing uses or accepts contexts in fasthttp at the moment. I though it would be weird to only add it to this function. I guess one day someone will make ...WithContext function variants for most fasthttp functions.
Most helpful comment
@valyala I think there is a legitimate need for this instead of people having to write custom listener.