-
Feature
-
Resolution: Done
-
Normal
-
None
-
None
Add iterator-based vulnerability/enrichment writes to the existing DB APIs.
Ensure backward compatibility with non-iterator interfaces.
Quoting hdonnay:
I generally find that channels make for bad API surface because there's no way to communicate callee-cancellation (as in, if the function that has a channel passed in needs to exit early, the goroutine feeding the channel is live until GC or, if written correctly, a context expiration) and forces the use of an additional goroutine in otherwise straight-line code
the rangefunc stuff can still be driven manually, so that would be my preference if you want to pursue the change
Example/reference: https://github.com/quay/claircore/pull/1092/commits/123b1f68fe3fb2f1785de5c03b4ee6c0047976d3