tulipcore
tulipcore copied to clipboard
Add future/greenlet adaptors
Within asyncio code, we should be able to wait for greenlets like this:
@asyncio.coroutine
def some_routine():
yield from as_future(gevent.spawn(....))
Likewise, we should also be able to wait for futures in gevent code:
def gevent_handle():
wait_future(asyncio.sleep(1))
At last, we want to mix explicit asyncio yields and implicit gevent switches in one method:
@tulipcore.coroutine
def some_routine():
yield from asyncio.sleep(1)
gevent.sleep(1)
This would be extremely handy. I'd like to see some gunicorn demos soon!
https://github.com/decentfox/tulipcore/tree/coroutine