compose
compose copied to clipboard
(refactoring) introduce monitor to manage containers events and application termination
What I did refactoring:
- introduced
monitorto dispatch container events and manage application termination - re-implemented cascade stop as a separate component, relying on event dispatch
- re-implemented
watchcontainerrelying on event dispatch, removed fromstartandlog printeronly focus on rendering application status, not trying to detect termination - uses explicit termination- removed useless pre-allocation of
presenter(color) inprinter. Will be set on first use.
improvement (2nd commit): collecting start event, capture container's StartTime. This is used to collect logs using log API (we are too late to attach) and retrieve the very first logs. Tested using:
func main() {
fmt.Println("Hello, World!")
time.Sleep(10*time.Second)
}
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did