Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrite Manager: DAG → two-tier model
Replace the DAG-based
AppManagerwith a simpler two-tierManagerthat separates processes (foreground work) from services (infrastructure). On shutdown, processes are stopped first, then services.New API
Manager()— constructor, returns aRunnable.Register(...)— register processes (cancelled first during shutdown).RegisterService(...)— register services (cancelled after all processes stop).Name(string)— set a custom log prefix (default:"manager").ShutdownTimeout(dur)— set deadline per shutdown phase (default: 10s)ManagerRegistry— interface exposingRegister/RegisterServicefor passing to helper functionsWhat changed
manager.go— full rewrite. Two-tier run logic withcontext.WithoutCancel, event-driven shutdown via buffered channels (no polling ticker), two-phase cancellationmanager_container.go— deleted. No more per-runnable isolated contexts or DAG trackingmanager_test.go— 6 tests: cancellation, empty manager, dying process, dying service, shutdown timeout, shutdown orderingrun.go—RunGroupsimplified to useManager().Register()example_test.go,examples/— updated to new APIREADME.md— updated Manager sectionRemoved
AppManagerinterface,Build(),Add(runnable, ...dependencies)ManagerOption/ManagerShutdownTimeout()(replaced by fluent.ShutdownTimeout())managerContainer,managerContainerSet(entire file)