-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Here, continue service refactoring to its ultimate conclusion, and make the client itself a start/stop service, having a couple advantages: * (IMO) considerably simplifies the start and stop code, putting it all in one place, and largely even one function. Fewer helpers to follow around to understand what's going on. * Makes the client behave gracefully on double starts/stops. * Allows the client to easily handle start/stop under duress. Any number of goroutines can be starting or stopping it simultaneously and it's guaranteed free from races. Because the client's stop functions are different from the signature of other start/stop services (taking a context and returning an error), I had to modify the base start/stop service somewhat and allow for an additional `StopInit` helper (like `StartInit`) that lets stop behavior be customized while still providing race-free operations.
- Loading branch information
Showing
6 changed files
with
423 additions
and
163 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
Oops, something went wrong.