Skip to content
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

Use single shared ActionBlock #235

Open
JamieMagee opened this issue Aug 26, 2022 · 0 comments
Open

Use single shared ActionBlock #235

JamieMagee opened this issue Aug 26, 2022 · 0 comments
Labels
status:requirements Full requirements are not yet known, so implementation should not be started type:refactor Refactoring or improving of existing code

Comments

@JamieMagee
Copy link
Member

Currently we're creating a single ActionBlock per detector, however we should look into using one shared ActionBlock across all detectors.

We're running each detector here:

() => detector.ExecuteDetectorAsync(new ScanRequest(detectionArguments.SourceDirectory, exclusionPredicate, this.Logger, detectorArguments, detectionArguments.DockerImagesToScan, componentRecorder)),

Which eventually creates a new ActionBlock:

private async Task<IndividualDetectorScanResult> ProcessAsync(IObservable<ProcessRequest> processRequests, IDictionary<string, string> detectorArgs)
{
var processor = new ActionBlock<ProcessRequest>(async processRequest => await this.OnFileFound(processRequest, detectorArgs));

Recommended after speaking with @dfederm

@JamieMagee JamieMagee added status:requirements Full requirements are not yet known, so implementation should not be started type:refactor Refactoring or improving of existing code labels Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:requirements Full requirements are not yet known, so implementation should not be started type:refactor Refactoring or improving of existing code
Projects
Development

No branches or pull requests

1 participant