Commit 1cc3ceb5 authored by Jim Fulton's avatar Jim Fulton

Added a base class for creating asyncion API stubs

parent 6134baab
...@@ -111,3 +111,24 @@ class AsyncRPC: ...@@ -111,3 +111,24 @@ class AsyncRPC:
def __getattr__(self, name): def __getattr__(self, name):
return lambda *a, **kw: self.api.call(name, *a, **kw) return lambda *a, **kw: self.api.call(name, *a, **kw)
class ClientRunner:
def __init__(self, addr, client, cache, storage, read_only, timeout,
**kw):
self.addr = addr
self.client = client
self.cache = cache
self.storage = storage
self.read_only = read_only
self.timeout = timeout,
for name in kw:
self.__dict__[name] = kw[name]
def start(self, wait=True):
pass
def call(self, method, *args, timeout=None):
return getattr(self, method)(*args)
async = async_iter = call
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment