-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: Slightly rework main hub and gui lifecycle.
This moves the creation of the context into the main code path, splits the creation logic for the hub and gui into independent funcs, and arranges for the main code path to create those instances and run them. Since the pool struct is no longer necessary, both it and the associated newPool func are removed. This approach is preferred because it provides the main code path with full control over the lifecycle of the context instead of stuffing it into a separate struct which makes it much harder to reason about and has ultimately led to the use of the cancel func deep in the innards of the hub which should not have that level of control since it is not the coordinator and thus does not have enough details to know when it's actually safe or even should be forcing a shutdown. This commit does not address the latter part since it will require more in-depth changes to decouple it properly. However, this is a good start at reducing the overly-tight coupling of the lifecycle that exists as a result.
- Loading branch information
Showing
2 changed files
with
74 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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