gin-gonic / gin

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Home Page:https://gin-gonic.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graceful Restarts?

pyrossh opened this issue · comments

How about integrating zero downtime restarts in gin server? Maybe using endless?

https://github.com/fvbock/endless

Adding a library like that may opens a new world of issues. I am not considering a built-in support for this right now. Even though, I am interested in zero downtime restarts.

If you want to start using endless right now, just do this:

router := gin.Default()
router.GET("/", handler)
// [...]
endless.ListenAndServe(":4242", router)

I don't think it should be included in the library, it may be confusing for people just getting started with the library and may become an issue during development. I'm currently doing what @manucorporat suggested.

good tools is quick my develop speek!

commented

Manners by the folks at BrainTree seems like an alternative to endless 😃

@jacktuck Thanks. I already create new PR #561 to update README.

Adding a library like that may opens a new world of issues. I am not considering a built-in support for this right now. Even though, I am interested in zero downtime restarts.

If you want to start using endless right now, just do this:

router := gin.Default()
router.GET("/", handler)
// [...]
endless.ListenAndServe(":4242", router)

endless not supported under windows platform.

Why not add this functionality in gin lib itself? Do we have any blocker for it?