-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch away from using errChan in the manager
Instead of using an error channel in the manager, we just use a mutex and store one error. The "waiting" is done by blocking on a channel which gets closed to signal errors. This achives the same effect (only return one error) without having the chance of blocking goroutines; with the old code, goroutines could block trying to return their results (especially since a few tried to return nil results), and since runnables can be added after start, there's no way to appropriately size the channel to avoid this happening (plus no point, since we only report the first error anyway). We also only report errors when the occurred, never signaling for errors with a nil error value.
- Loading branch information
1 parent
0fdf465
commit fe4ada0
Showing
3 changed files
with
74 additions
and
15 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
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