On 27 July 2015 at 07:54, Sven R. Kunze firstname.lastname@example.org wrote:
Something that struck me as odd was that asyncio got syntactic sugar although the module itself is actually quite young compared to the support of processes and of threads. These two alternatives have actually no a single bit of syntax support until now.
Their shared abstraction layer is the concurrent.futures module: https://docs.python.org/3/library/concurrent.futures.html (available for Python 2 as the "futures" module on PyPI)
For "call and response" use cases involving pools of worker threads or processes, concurrent.futures is a better option than hand rolling our own pool management and request dispatch and response processing code.
That model is integrated into the asyncio event loop to support dispatching blocking tasks to a background thread or process.
-- Nick Coghlan | email@example.com | Brisbane, Australia