[Async-sig] asyncio <-> twisted interoperability

Yury Selivanov yselivanov at gmail.com
Fri Jun 3 19:44:35 EDT 2016


> On Jun 3, 2016, at 6:53 PM, Cory Benfield <cory at lukasa.co.uk> wrote:
> 
> 
>> On 3 Jun 2016, at 13:11, Yury Selivanov <yselivanov at gmail.com> wrote:
>> 
>> 2.1. There should be a way for Deferred objects to get the currently running event loop reliably. There is a pending PR to add the new ‘asyncio.get_running_loop’ function.  If we land it in 3.5.2, Deferred object will be able to get the currently running event loop and schedule callbacks in a fair fashion, similarly to Futures.
>> 
> 
> Let’s pretend I’m an idiot for a moment. ;)
> 
> Why do we want Twisted to schedule callbacks in the asyncio style? Is this intended to be a compatibility mode for Twisted whereby in an asyncio runner Deferreds emulate Futures? Is it required that Deferreds behave in this way to be awaitable in Python 3.5+?


2.1 is not strictly necessary.  Although I would really prefer that any Twisted code I use within an asyncio application will behave like asyncio code (if that’s possible).

Yury


More information about the Async-sig mailing list