Open samber opened 1 year ago
Hello, thanks for this proposal. I like this idea, my 2 cents here is :
If we already return information about the shutdown, perhaps we can also return several other informations. e.g. the number of services actually closed, the time elapsed, potential errors.
My proposal :
shutdownFeedback, err := do.Shutdown()
type ShutdownFeedback struct {
All time.Duration
Services map[string]time.Duration
ServicesError map[string]error // each errors returned by each services shutdown
servicesTurnedOff int
// maybe something else ?
}
My monolith application relies a lot on
do.Shutdownable
interface. Some tasks call database or third-parties, and flush buffer.I would like to measure the time of the
do.Shutdown
processing.API proposal:
duration, err := do.Shutdown()
duration
would be either atime.Duration
or:WDYT ?