tulipcore icon indicating copy to clipboard operation
tulipcore copied to clipboard

Add future/greenlet adaptors

Open fantix opened this issue 11 years ago • 2 comments

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)

fantix avatar Apr 28 '14 05:04 fantix

This would be extremely handy. I'd like to see some gunicorn demos soon!

graingert avatar May 08 '14 00:05 graingert

https://github.com/decentfox/tulipcore/tree/coroutine

fantix avatar May 08 '14 03:05 fantix