Send data to asyncio coroutine

jcarmena at jcarmena at
Tue Jul 21 13:31:29 CEST 2015

Hello, I'm trying to understand and link asyncio with ordinary coroutines. Now I just want to understand how to do this on asyncio:

def foo():
    data = yield 8
    yield "bye"
def bar():
    f = foo()
    n =
    message = f.send("hello")

What is the equivalent for coro.send("some data") in asyncio?

coro.send on an asyncio coroutine throws AssertionError: yield from wasn't used with future.

Thank you

More information about the Python-list mailing list