Muhammad D Vikar
Muhammad D Vikar

Reputation: 161

How to set context to ProcessPoolExecutor in apscheduler

from apscheduler.executor.pool import ProcessPoolExecutor

from apscheduler.scheduler.blocking import BlockingScheduler

from multiprocessing import get_context

context = {'mp_context': get_context('spawn')}

executor = Processpoolexecutor(max_workers=4, pool_kwargs=context)

scheduler = BlockingScheduler()

scheduler.configure(executors=executor)


Give me error Processpoolexecutor object has no attribute items

What I trying to do is to make sure worker process in spawn mode not fork mode in linux

I try change the dict value to spawn but get error str no have attribute mp_context

Upvotes: 0

Views: 73

Answers (0)

Related Questions