Scheduled Thread Pool Executor implementation in python
Makes use of delayed queue implementation to submit tasks to the thread pool.
from scheduled_thread_pool_executor import ScheduledThreadPoolExecutor scheduled_executor = ScheduledThreadPoolExecutor(max_workers=5) scheduled_executor.schedule(task, 0) # equals to schedule once, where task is a callable scheduled_executor.schedule_at_fixed_rate(task, 0, 5) # schedule immediately and run periodically for every 5 secs scheduled_executor.schedule_at_fixed_delay(task, 5, 10) # schedule after 5secs (initial delay) and run periodically for every 10secs
This project has been set up using PyScaffold 4.1.1. For details and usage information on PyScaffold see https://pyscaffold.org/.