lbry-sdk/lbrynet/extras/compat.py

10 lines
213 B
Python

import asyncio
from twisted.internet import defer
def d2f(deferred):
return deferred.asFuture(asyncio.get_event_loop())
def f2d(future):
return defer.Deferred.fromFuture(asyncio.ensure_future(future))