def wrap(func, *args, **kwargs):
    """Wrap a callable as a task. Yield the boolean of its result.
    """
    def initTask(**initkwargs):
        def makeIterator(**runkwargs):
            result = func(*args, **kwargs)
            yield bool(result)
        try: makeIterator.__name__ = func.__name__
        except AttributeError: pass
        try: makeIterator.__doc__ = func.__doc__
        except AttributeError: pass
        return makeIterator
    try: initTask.__doc__ = func.__doc__
    except AttributeError: pass
    try: initTask.__name__ = func.__name__
    except AttributeError: pass
    return initTask