@asyncio.coroutine
def consumer(queue, num_expected):
    for _ in range(num_expected):
        (yield from queue.get())
@asyncio.coroutine
def consumer(queue, num_expected):
    for _ in range(num_expected):
        (yield from queue.get())