Commit ae4d9496 authored by Jim Fulton's avatar Jim Fulton

eliminate a needless layer of futures

And make waiting for reconnect a little easier.
parent a4eca036
......@@ -681,7 +681,6 @@ class ClientRunner:
self.__args = (addrs, wrapper, cache, storage_key, read_only,
disconnect_poll)
self.timeout = timeout
self.connected = concurrent.futures.Future()
def setup_delegation(self, loop):
self.loop = loop
......@@ -699,14 +698,6 @@ class ClientRunner:
self.__call = call
@self.client.connected.add_done_callback
def thread_done_connecting(future):
e = future.exception()
if e is not None:
self.connected.set_exception(e)
else:
self.connected.set_result(None)
def wait_for_result(self, future, timeout):
try:
return future.result(self.timeout if timeout is False else timeout)
......@@ -816,7 +807,7 @@ class ClientThread(ClientRunner):
def start(self, wait=True):
if wait:
self.wait_for_result(self.connected, self.timeout)
self.wait_for_result(self.client.connected, self.timeout)
closed = False
def close(self):
......
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