▲ 2 ▼ New Go 1.8 features inside Iris web framework!
Docs: https://godoc.org/gopkg.in/kataras/iris.v6
Ok mates, I had been asleep to finish the latest touches, Iris has been re-based and embraced the new Go 1.8 features , i.e Server Push, Shutdown. Go give it a try!
Register to comment or vote on this story
How are you finding the graceful shutdown, have you been testing it on servers you run? I imagine it's only useful where you have at least a few instances running behind a load balancer, as otherwise you can't easily switch from one binary on the same port to another. In principle though it sounds nice - makes it easier to have zero downtime deploys which even in-flight requests don't notice at all.
Edit:
Oh I see what you mean, yes it doesn't supports these things, it couldn't, for that level of gracefully shutdown you're describing we would need a different application on top of our servers, i.e a different process (if I understand correctly, you're talking about hot-reloading and graceful restart with the new source code changes(rebuild) without online clients to be affected or disconnected or losing state. Some programming languages like elixir can do that because they're working on a totally functional way, func input -> output without side affects to the rest of the application, golang can't do that, it has structs and pointers). This graceful shutdown makes the server wait to close any opening connections and it stops new from connecting until the server closed. On the `Shutdown` you can pass a context with a time limit(deadline on how much you're willing to wait in order to close the server) too. Before go 1.8 we did it with custom net.Listener and channels with a 'stop' or/and different conn states, it was awful, now is better.
I find it very handy, it solves boilerplate code (although I think it has downside on performance for 'hello worlds' apps, authors said that they will probably 'fix' it on go 1.9).