Features¶
Async¶
A
futurist.GreenThreadPoolExecutorusing eventlet green thread pools. It provides a standard executor API/interface and it also gathers execution statistics. It returns instances offuturist.GreenFutureobjects.A
futurist.ProcessPoolExecutorderivative that gathers execution statistics. It returns instances offuturist.Futureobjects.A
futurist.SynchronousExecutorthat doesn’t run concurrently. It has the same executor API/interface and it also gathers execution statistics. It returns instances offuturist.Futureobjects.A
futurist.ThreadPoolExecutorderivative that gathers execution statistics. It returns instances offuturist.Futureobjects.
Delayed Execution¶
A
futurist.DelayedExecutorMixinthat can be combined with anyExecutorsubclass to add asubmit_after(delay, fn, *args, **kwargs)method. A single background scheduler thread maintains a min-heap of pending tasks ordered by deadline; tasks can be cancelled while waiting via the returnedFuture. Usefuturist.GreenDelayedExecutorMixinwhen working with eventlet- based executors.
Periodics¶
A
futurist.periodics.PeriodicWorkerthat can use the previously mentioned executors to run asynchronous work periodically in parallel or synchronously. It does this by executing arbitrary functions/methods that have been decorated with thefuturist.periodics.periodic()decorator according to a internally maintained schedule (which itself is based on the heap algorithm).