Skip to content

v0.2.0

Choose a tag to compare

@ankurs ankurs released this 27 Apr 07:53
· 4 commits to main since this release
f36bb4e

Workers integration + lifecycle hooks

Add 5 optional interfaces for service lifecycle management, following the existing CBStopper/CBGracefulStopper pattern:

  • CBWorkerProvider — run background workers managed by go-coldbrew/workers
  • CBPreStarter — setup before servers start (DB connections, auth interceptors)
  • CBPostStarter — act after server goroutines launch (service discovery)
  • CBPreStopper — act before graceful shutdown (deregister, flush)
  • CBPostStopper — final cleanup after everything stops

Lifecycle

PreStart → initGRPC → initHTTP → start workers → start servers → PostStart
→ block → PreStop → FailCheck → drain → stop workers → stop servers → Stop → PostStop

Config

  • Added env:"" tags on all Config fields alongside envconfig:"" for modern ecosystem compat
  • Added Config.ValidateStrict() []error for programmatic validation

Other

  • 100% backward compatible — CB interface unchanged, existing services work without modification
  • Bumped go-coldbrew/workers to v0.2.1