You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use "service" with my webservice.
I use https://github.com/facebookgo/grace for graceful shutdown.
-> server waits until connections are closed so no data gets lost.
This only works when I change your code to not being async.
// Program structures.// Define Start and Stop methods.typeprogramstruct {
}
func (p*program) Start(s service.Service) error {
//go p.run()//return nilreturngracehttp.Serve(e.Routes().Server("0.0.0.0:3000"))
}
func (p*program) Stop(s service.Service) error {
// Any work in Stop should be quick, usually a few seconds at most.logger.Info("I'm Stopping!")
returnnil
}
Does it have to be async? Will I have problems using "service"?
best
ps: govendor is great! Saved my sanity today :)
The text was updated successfully, but these errors were encountered:
dryaf
changed the title
server + httpserver + graceful shutdown
service + httpserver + graceful shutdown
Apr 7, 2016
I integrated something similar for a PR for Caddy. However I've never looked closely at facebook's grace. It might be possible to integrate, but I'll need to look into how grace works. Feel free to also describe how it works too.
Hi,
I'd like to use "service" with my webservice.
I use https://github.com/facebookgo/grace for graceful shutdown.
-> server waits until connections are closed so no data gets lost.
This only works when I change your code to not being async.
Does it have to be async? Will I have problems using "service"?
best
ps: govendor is great! Saved my sanity today :)
The text was updated successfully, but these errors were encountered: