def coroutine(func):
    """Decorator for priming generator-based coroutines.
    """
    @wraps(func)
    def start(*args, **kwargs):
        g = func(*args, **kwargs)
        next(g)
        return g

    return start