(f: Callable, *args, **kw)
Same as twisted.internet.defer.maybeDeferred, but delay calling
    callback/errback to next reactor loop
Same as twisted.internet.defer.maybeDeferred, but delay calling
    callback/errback to next reactor loop
Same as twisted . internet . defer . maybeDeferred but delay calling callback / errback to next reactor loop
def mustbe_deferred(f: Callable, *args, **kw) -> Deferred:
    """Same as twisted.internet.defer.maybeDeferred, but delay calling
    callback/errback to next reactor loop
    """
    try:
        result = f(*args, **kw)
    # FIXME: Hack to avoid introspecting tracebacks. This to speed up
    # processing of IgnoreRequest errors which are, by far, the most common
    # exception in Scrapy - see #125
    except IgnoreRequest as e:
        return defer_fail(failure.Failure(e))
    except Exception:
        return defer_fail(failure.Failure())
    else:
        return defer_result(result)
def mustbe_deferred ( f : Callable , * args , * * kw ) -> Deferred : try : result = f ( * args , * * kw ) # FIXME: Hack to avoid introspecting tracebacks. This to speed up # processing of IgnoreRequest errors which are, by far, the most common # exception in Scrapy - see #125 except IgnoreRequest as e : return defer_fail ( failure . Failure ( e ) ) except Exception : return defer_fail ( failure . Failure ( ) ) else : return defer_result ( result )