cisagov / findcdn

findCDN is a tool created to help accurately identify what CDN a domain is using.
Creative Commons Zero v1.0 Universal
96 stars 14 forks source link

Specify number of threads for workers #7

Closed KyleEvers closed 4 years ago

KyleEvers commented 4 years ago

🚀 Feature Proposal

Let the user specify the number of threads to run the program.

Motivation

The user should be able to specify the number of threads to be used for the program to make the program more portable.

Example

Example of single threaded or 16 threads

dyFront -s file <fileIn> [-o FILE]
dyFront -t 16 file <fileIn> [-o FILE]

Pitch

This will make the tool more modular including being used on servers, personal computers, or severless architecture.

Pascal-0x90 commented 4 years ago

This feature is added as of commit b47c22bbc195828804e1c05154e5a56fe6c63c5e . findCDN uses the concurrent.futures.ThreadPoolExecutor method which will define the default amount of threads by:

min(32, os.cpu_count() + 4) 

We are able to override this by passing a max_workers value when defining the ThreadPoolExecutor object. This is now the value that gets passed in to the program by the user.