twisted.internet.defer.Deferred.fromFuture(cls, future) class method documentationtwisted.internet.defer.Deferred
View Source
Adapt an asyncio.Future to a Deferred.
| Parameters | future | The Future to adapt. (type: asyncio.Future) |
| Returns | A Deferred which will fire when the Future fires. (type: Deferred) | |
| Present Since | Twisted 17.5.0 | |
| Note | This creates a Deferred from a asyncio.Future, not from a coroutine; in other words, you will need to call asyncio.ensure_future, asyncio.loop.create_task or create an asyncio.Task yourself to get from a coroutine to a asyncio.Future if what you have is an awaitable coroutine and not a asyncio.Future. (The length of this list of techniques is exactly why we have left it to the caller!) | |