lbry-sdk/lbrynet/extras/compat.py

11 lines
213 B
Python
Raw Normal View History

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))