Loading doc/fundamentals.rst +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ can disable this behavior with the `disable_fallback` parameter of the a special rpc message "capabilities" is received. .. note:: When the fallback mode is enabled, you can't use another protocols than the default rpc. All calls to :meth:`RpcConnection.register_protocol`, :meth:`RpcConnection.unregister_protocol`, :meth:`RpcConnection.create_rpc` Loading sjrpc/core/async.py +13 −10 Original line number Diff line number Diff line Loading @@ -9,11 +9,13 @@ class AsyncWatcher(object): ''' Asynchronous call watcher -- Handle asynchronous calls and responses. Usage example: Usage example:: >>> watcher = AsyncWatcher() >>> watcher.register(conn1, 'ping') >>> watcher.register(conn2, 'ping') >>> responses = watcher.wait() # Wait for all responses ''' def __init__(self): Loading Loading @@ -64,9 +66,10 @@ class AsyncWatcher(object): :return: received messages in a list .. note:: You can repeat call to this method on a single :class:`AsyncWatcher`. For example, if you want to process the first arrived message, then wait others for a minute, you can do: first arrived message, then wait others for a minute, you can do:: >>> msgs = watcher.wait(max_wait=1) >>> process_speedy(msgs[0]) Loading Loading
doc/fundamentals.rst +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ can disable this behavior with the `disable_fallback` parameter of the a special rpc message "capabilities" is received. .. note:: When the fallback mode is enabled, you can't use another protocols than the default rpc. All calls to :meth:`RpcConnection.register_protocol`, :meth:`RpcConnection.unregister_protocol`, :meth:`RpcConnection.create_rpc` Loading
sjrpc/core/async.py +13 −10 Original line number Diff line number Diff line Loading @@ -9,11 +9,13 @@ class AsyncWatcher(object): ''' Asynchronous call watcher -- Handle asynchronous calls and responses. Usage example: Usage example:: >>> watcher = AsyncWatcher() >>> watcher.register(conn1, 'ping') >>> watcher.register(conn2, 'ping') >>> responses = watcher.wait() # Wait for all responses ''' def __init__(self): Loading Loading @@ -64,9 +66,10 @@ class AsyncWatcher(object): :return: received messages in a list .. note:: You can repeat call to this method on a single :class:`AsyncWatcher`. For example, if you want to process the first arrived message, then wait others for a minute, you can do: first arrived message, then wait others for a minute, you can do:: >>> msgs = watcher.wait(max_wait=1) >>> process_speedy(msgs[0]) Loading