-
Notifications
You must be signed in to change notification settings - Fork 311
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
refactor(processor): stop using global variables #2881
Conversation
Codecov ReportBase: 49.66% // Head: 49.54% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2881 +/- ##
==========================================
- Coverage 49.66% 49.54% -0.13%
==========================================
Files 316 315 -1
Lines 50433 50108 -325
==========================================
- Hits 25048 24826 -222
+ Misses 23853 23765 -88
+ Partials 1532 1517 -15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
4586717
to
15e9e5c
Compare
ab30819
to
b6bee8b
Compare
} | ||
|
||
// AsyncInit is a helper object to wait for multiple asynchronous initialization events. | ||
type AsyncInit struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like WaitContext
is used in tests only. Why not use a WaitGroup
instead of creating this new AsyncInit
type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a wait group was my initial approach, but WaitGroup#Wait
is a blocking call, whereas listening from a channel doesn't have to be. Consider this as a WaitGroup
using a channel for communicating completion instead of blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, it's not too complex either so 👍
b6bee8b
to
3d899b5
Compare
3d899b5
to
138fbc2
Compare
Description
Preparation steps before starting the actual work for introducing workspace isolation in processor:
processor
packageprocessor.HandleT
toprocessor.Handle
misc.AsyncInit
for streamlining how our components wait for their proper initialization before actually starting working (hint:backendconfig.WaitForConfig
is not 100% safe)misc.AsyncInit
)Notion Ticket
Link
Security