cobra.util.process_pool#

Provide a process pool with enhanced performance on Windows.

Classes#

ProcessPool

Define a process pool that handles the Windows platform specially.

Module Contents#

class cobra.util.process_pool.ProcessPool(processes: int | None = None, initializer: Callable | None = None, initargs: Tuple = (), maxtasksperchild: int | None = None, **kwargs)[source]#

Define a process pool that handles the Windows platform specially.

_filename = None#
_pool#
__getattr__(name: str, **kwargs) Any[source]#

Defer attribute access to the pool instance.

__enter__() ProcessPool[source]#

Enable context management.

__exit__(exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None) bool | None[source]#

Clean up resources when leaving a context.

close() None[source]#

Close the process pool.

Prevent any more tasks from being submitted to the pool. Once all the tasks have been completed, the worker processes will exit.

_clean_up() None[source]#

Remove the dump file if it exists.