@asyncio.coroutine
def producer(queue, num_items):
    for i in range(num_items):
        (yield from queue.put(i))
@asyncio.coroutine
def producer(queue, num_items):
    for i in range(num_items):
        (yield from queue.put(i))