auto_pruners.base
AutoPrunerBase Objects
class AutoPrunerBase(ABC)
Abstract base class for automatic execution pruners.
Pruners monitor execution and can terminate processes based on custom conditions. Multiple pruners can be active simultaneously.
should_prune
@abstractmethod
def should_prune() -> bool
Check if the command should be terminated.
Returns:
bool
- True if command should be terminated, False otherwise
on_start
@abstractmethod
def on_start() -> None
Called when command execution starts.
This method is called before command execution begins to initialize the pruner's internal state and prepare for monitoring.
on_end
@abstractmethod
def on_end() -> None
Called when command execution ends.
This method is called after command execution completes (whether successful, failed, or pruned) to clean up resources and perform final operations.