Skip to content

(refactoring) introduce monitor to manage containers events and application termination #12906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Jun 5, 2025

What I did
refactoring:

  • introduced monitor to dispatch container events and manage application termination
  • re-implemented cascade stop as a separate component, relying on event dispatch
  • re-implemented watchcontainer relying on event dispatch, removed from start and log
  • printer only focus on rendering application status, not trying to detect termination - uses explicit termination
  • removed useless pre-allocation of presenter (color) in printer. 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
image

@ndeloof ndeloof force-pushed the refactoring_events branch 10 times, most recently from 38f188f to a1a3ba1 Compare June 12, 2025 09:23
@ndeloof ndeloof force-pushed the refactoring_events branch 2 times, most recently from 4725733 to 842aad6 Compare June 12, 2025 13:50
@ndeloof ndeloof marked this pull request as ready for review June 12, 2025 15:07
@ndeloof ndeloof requested a review from a team as a code owner June 12, 2025 15:07
@ndeloof ndeloof requested a review from glours June 12, 2025 15:07
@ndeloof ndeloof force-pushed the refactoring_events branch from 842aad6 to 4830d0a Compare June 12, 2025 15:07
ndeloof added 2 commits June 17, 2025 17:08
…cation termination

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof force-pushed the refactoring_events branch from 4830d0a to fa1bc3c Compare June 17, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant