RunPool#
- class maize.core.runtime.RunPool(*items: Runnable, wait_time: float = 1)[source]#
Bases:
object
Context manager for running a pool of processes.
Upon entering, will start one process for each item with the execute method as the target. Exiting will cause all processes to be joined within wait_time, and any remaining ones will be terminated.
- Parameters:
items – Items of type Runnable
wait_time – Time to wait when joining processes before issuing a termination signal
Methods
__init__
(*items[, wait_time])Attributes
Returns the total number of processes.