(proxy)
return caller
Returns an asynchronous "version" of the given proxy. Invoking the returned
    proxy will not block; instead it will return an 
    :class:`rpyc.core.async.AsyncResult` object that you can test for completion
    
    :param proxy: any **callable** RPyC proxy
    
    :returns: the proxy, wrapped by an asynchronous wrapper
    
    Example::
    
        async_sleep = rpyc.async(conn.modules.time.sleep)
        res = async_sleep(5)
    
    .. _async_note:
    
    .. note:: 
       In order to avoid overloading the GC, the returned asynchronous wrapper is 
       cached as a weak reference. Therefore, do not use::
           
           rpyc.async(foo)(5)
       
       Always store the returned asynchronous wrapper in a variable, e.g. ::
       
           a_foo = rpyc.async(foo)
           a_foo(5)
Returns an asynchronous "version" of the given proxy. Invoking the returned
    proxy will not block; instead it will return an 
    :class:`rpyc.core.async.AsyncResult` object that you can test for completion
    
    :param proxy: any **callable** RPyC proxy
    
    :returns: the proxy, wrapped by an asynchronous wrapper
    
    Example::
    
        async_sleep = rpyc.async(conn.modules.time.sleep)
        res = async_sleep(5)
    
    .. _async_note:
    
    .. note:: 
       In order to avoid overloading the GC, the returned asynchronous wrapper is 
       cached as a weak reference. Therefore, do not use::
           
           rpyc.async(foo)(5)
       
       Always store the returned asynchronous wrapper in a variable, e.g. ::
       
           a_foo = rpyc.async(foo)
           a_foo(5)
Returns an asynchronous version of the given proxy . Invoking the returned proxy will not block ; instead it will return an : class : rpyc . core . async . AsyncResult object that you can test for completion : param proxy : any ** callable ** RPyC proxy : returns : the proxy wrapped by an asynchronous wrapper Example :: async_sleep = rpyc . async ( conn . modules . time . sleep ) res = async_sleep ( 5 ) .. _async_note : .. note :: In order to avoid overloading the GC the returned asynchronous wrapper is cached as a weak reference . Therefore do not use :: rpyc . async ( foo ) ( 5 ) Always store the returned asynchronous wrapper in a variable e . g . :: a_foo = rpyc . async ( foo ) a_foo ( 5 )
def async(proxy):
    """
    Returns an asynchronous "version" of the given proxy. Invoking the returned
    proxy will not block; instead it will return an 
    :class:`rpyc.core.async.AsyncResult` object that you can test for completion
    
    :param proxy: any **callable** RPyC proxy
    
    :returns: the proxy, wrapped by an asynchronous wrapper
    
    Example::
    
        async_sleep = rpyc.async(conn.modules.time.sleep)
        res = async_sleep(5)
    
    .. _async_note:
    
    .. note:: 
       In order to avoid overloading the GC, the returned asynchronous wrapper is 
       cached as a weak reference. Therefore, do not use::
           
           rpyc.async(foo)(5)
       
       Always store the returned asynchronous wrapper in a variable, e.g. ::
       
           a_foo = rpyc.async(foo)
           a_foo(5)
    """
    pid = id(proxy)
    if pid in _async_proxies_cache:
        return _async_proxies_cache[pid]
    if not hasattr(proxy, "____conn__") or not hasattr(proxy, "____oid__"):
        raise TypeError("'proxy' must be a Netref: %r", (proxy,))
    if not callable(proxy):
        raise TypeError("'proxy' must be callable: %r" % (proxy,))
    caller = _Async(proxy)
    _async_proxies_cache[id(caller)] = _async_proxies_cache[pid] = caller
    return caller
def async ( proxy ) : pid = id ( proxy ) if pid in _async_proxies_cache : return _async_proxies_cache [ pid ] if not hasattr ( proxy , "____conn__" ) or not hasattr ( proxy , "____oid__" ) : raise TypeError ( "'proxy' must be a Netref: %r" , ( proxy , ) ) if not callable ( proxy ) : raise TypeError ( "'proxy' must be callable: %r" % ( proxy , ) ) caller = _Async ( proxy ) _async_proxies_cache [ id ( caller ) ] = _async_proxies_cache [ pid ] = caller return caller