temporary module providing d2f and f2d for converting between twisted and asyncio
This commit is contained in:
parent
fb4e94b04a
commit
6c52450858
1 changed files with 10 additions and 0 deletions
10
lbrynet/extras/compat.py
Normal file
10
lbrynet/extras/compat.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
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))
|
Loading…
Reference in a new issue