コード例 #1
0
def asynchronous(func):
    """Decorates callable object as asynchronous and make possible to yield framework's deferreds and futures in it.

    Decorator transforms any callable object, making deferred callable object. In fact, invocation event is pushed
    in the event loop, which calls it later as it turn comes.

    Decorated objects gain ability to `yield` all framework's futures and deferreds as like as tornado and python 3.3.
    futures.

    As the callable object becomes deferred, it can be `yielded` in another `asynchronous` decorated function, making
    possible to create large chains of asynchronous invocations.
    """
    return chain.source(func)
コード例 #2
0
def asynchronous(func):
    """Decorates callable object as asynchronous and make possible to yield framework's deferreds and futures in it.

    Decorator transforms any callable object, making deferred callable object. In fact, invocation event is pushed
    in the event loop, which calls it later as it turn comes.

    Decorated objects gain ability to `yield` all framework's futures and deferreds as like as tornado and python 3.3.
    futures.

    As the callable object becomes deferred, it can be `yielded` in another `asynchronous` decorated function, making
    possible to create large chains of asynchronous invocations.
    """
    return chain.source(func)
コード例 #3
0
 def async (cls, func):
     return chain.source(func)
コード例 #4
0
def asynchronous(func):
    return chain.source(func)