Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat min_workers=0 as "scale to zero", None to deactivate #256

Merged
merged 2 commits into from
Feb 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion deadpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ def __init__(
self.finitializer = finalizer
self.finitargs = finalargs
self.pool_size = max_workers or len(os.sched_getaffinity(0))
self.min_workers = min_workers or self.pool_size
if min_workers is None:
self.min_workers = self.pool_size
else:
self.min_workers = min_workers

self.max_tasks_per_child = max_tasks_per_child
self.max_worker_memory_bytes = max_worker_memory_bytes
self.submitted_jobs: PriorityQueue[PrioritizedItem] = PriorityQueue(
Expand Down
Loading