kirkpatrickprice / PIIDigger

Program to identify Personally Identifiable Information in common file types
Apache License 2.0
2 stars 0 forks source link

Improve Process Management #19

Closed flyguy62n closed 3 months ago

flyguy62n commented 4 months ago

Problem

The current PIIDigger lacks a consistent way to start up and shutdown the processes. This makes events like KeyboardInterrupt difficult to manage and results in the occasional hang while trying to shutdown from unexpected events.

Use Case

As a user, the shutdown process should be better managed to ensure a consistent end to the program, especially when unexpected events are handled.

Requirements

A process manager class should manage the following:

Inputs

register

The register method should accept the following inputs:

The register method will also keep track of each of the processes that will be started, so that it can manage them later.

start

No inputs are required for this method.

The start method will start each sub-process in the order defined in start_order. A shutdown_order will be defined which can be used by wait_for_processes and terminate_all_processes to effect an orderly shutdown.

start should be callable multiple times and keep track of processes that have already been started.

wait_for_processes

No inputs are required

terminate_all_processes

No inputs are required.

Outputs

No outputs are expected other than typical Python behavior when instantiating a new instance of the class.