Skip to content

Commit

Permalink
Merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rcschrg committed Mar 11, 2024
2 parents f642e1c + 0a2770a commit 01adf6a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mango/util/scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,9 @@ def __init__(
self._scheduled_process_tasks: List[
Tuple[ScheduledProcessTask, Future, ScheduledProcessControl, Any]
] = []
self._process_pool_exec = concurrent.futures.ProcessPoolExecutor(
max_workers=num_process_parallel, initializer=_create_asyncio_context
)
self._manager = None
self._num_process_parallel = num_process_parallel
self._process_pool_exec = None
self._suspendable = suspendable
self._observable = observable

Expand Down Expand Up @@ -667,6 +666,11 @@ def schedule_process_task(self, task: ScheduledProcessTask, src=None):
:type src: Object
"""

if self._process_pool_exec is None:
self._process_pool_exec = concurrent.futures.ProcessPoolExecutor(
max_workers=self._num_process_parallel,
initializer=_create_asyncio_context,
)
loop = asyncio.get_running_loop()
if self._manager is None:
self._manager = Manager()
Expand Down

0 comments on commit 01adf6a

Please sign in to comment.