flower (flow er) is a package that provides an idiomatic, simple and an expressive way of defining how services (goroutines) should be started and gracefully closed.
- Simple API
- Uses
context.Context - Hookable functions (e.g.
BeforeServiceStart) - Configurable panic recovery
go get -u github.com/advbet/flower
The key concept comes from flower's ServiceGroup structure. It is a unit that is composed
out of many services (goroutines). Within a service group, all goroutines start/close
nondeterministically. However, the order of service groups are respected; each service
group will start only after the previous group has started, and will close only when
the superseding service group is closed. See _example for more details.
Project is still in experimental phase, breaking changes may happen.