[issue24571] [RFE] Add asyncio.blocking_call API

2015-07-06 Thread Sven R. Kunze
Sven R. Kunze added the comment: 2 remarks: 1) I would rather go for a more comprehensible name such as 'get_awaitable' instead of 'blocking_call'. Later reminds me of the execution of f which is not the case. 2) redundant ) in the end of """Usage: result = await asyncio.blocking_call(f, *ar

[issue24571] [RFE] Add asyncio.blocking_call API

2015-07-06 Thread Sven R. Kunze
Sven R. Kunze added the comment: Thanks for taking the initiative here, Nick. I created a follow-up on this: http://bugs.python.org/issue24578 In order to bridge both worlds, projects might need convenient way from and to either world (classic and asyncio). -- components: +asyncio nos

[issue24571] [RFE] Add asyncio.blocking_call API

2015-07-05 Thread Nick Coghlan
New submission from Nick Coghlan: Based on a current python-dev discussion, I'd like to suggest a high level convenience API in asyncio to dispatch a blocking call out to a separate thread or process: # Call blocking operation from asynchronous code def blocking_call(f, *args, **kwds):