From 90c55f26064baa9f714e7541147a67210387deed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Fri, 23 Dec 2016 13:33:59 +0100 Subject: [PATCH] cleanup again --- coolamqp/cluster.py | 6 +++--- coolamqp/handler.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coolamqp/cluster.py b/coolamqp/cluster.py index ab366e5..084663a 100644 --- a/coolamqp/cluster.py +++ b/coolamqp/cluster.py @@ -211,15 +211,15 @@ class Cluster(object): self.thread.start() return self - def shutdown(self, complete_outstanding_tasks=False): + def shutdown(self, complete_remaining_tasks=False): """ Cleans everything and returns. - :param complete_outstanding_tasks: if set to True, pending operations will be completed. + :param complete_remaining_tasks_tasks: if set to True, pending operations will be completed. If False, thread will exit without completing them. This can mean that if the cluster doesn't come up online, shutdown MAY BLOCK FOREVER. """ - self.thread.complete_outstanding_upon_termination = complete_outstanding_tasks + self.thread.complete_remaining_upon_termination = complete_remaining_tasks self.thread.terminate() self.thread.join() # thread closes the AMQP uplink for us diff --git a/coolamqp/handler.py b/coolamqp/handler.py index fd32f62..e98dbc1 100644 --- a/coolamqp/handler.py +++ b/coolamqp/handler.py @@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) class _ImOuttaHere(Exception): """Thrown upon thread terminating. - Thrown only if complete_outstanding_upon_termination is False""" + Thrown only if complete_remaining_upon_termination is False""" class ClusterHandlerThread(threading.Thread): @@ -32,7 +32,7 @@ class ClusterHandlerThread(threading.Thread): self.cluster = cluster self.is_terminating = False - self.complete_outstanding_upon_termination = False + self.complete_remaining_upon_termination = False self.order_queue = collections.deque() # queue for inbound orders self.event_queue = queue.Queue() # queue for tasks done self.connect_id = -1 # connectID of current connection @@ -81,7 +81,7 @@ class ClusterHandlerThread(threading.Thread): self.backend = None # good policy to release resources before you sleep time.sleep(exponential_backoff_delay) - if self.is_terminating and (not self.complete_outstanding_upon_termination): + if self.is_terminating and (not self.complete_remaining_upon_termination): raise _ImOuttaHere() exponential_backoff_delay = min(60, exponential_backoff_delay * 2) -- GitLab