diff --git a/coolamqp/attaches/declarer.py b/coolamqp/attaches/declarer.py index 00dafb32bc9805b712453cd0ea6e05692c8f205a..54ecee778d07dd9dff86c618587ba996bc0952c3 100644 --- a/coolamqp/attaches/declarer.py +++ b/coolamqp/attaches/declarer.py @@ -9,7 +9,6 @@ import logging from coolamqp.framing.definitions import ChannelOpenOk, ExchangeDeclare, ExchangeDeclareOk, QueueDeclare, \ QueueDeclareOk, ChannelClose from coolamqp.attaches.channeler import Channeler, ST_ONLINE, ST_OFFLINE -from coolamqp.uplink import PUBLISHER_CONFIRMS, MethodWatch, FailWatch from coolamqp.attaches.utils import AtomicTagger, FutureConfirmableRejectable, Synchronized from coolamqp.objects import Future, Exchange, Queue, Callable diff --git a/coolamqp/clustering/cluster.py b/coolamqp/clustering/cluster.py index a0a5f44786e1b49d508abec74c1ce9cae2e96bd2..1834eb838c959905e5ce839abf906fe917f76f51 100644 --- a/coolamqp/clustering/cluster.py +++ b/coolamqp/clustering/cluster.py @@ -27,6 +27,8 @@ class Cluster(object): This has ListenerThread. Call .start() to connect to AMQP. + + It is not safe to fork() after .start() is called, but it's OK before. """ # Events you can be informed about diff --git a/coolamqp/uplink/listener/thread.py b/coolamqp/uplink/listener/thread.py index 6e5d2dce995a97545852fe6fd087ba381d5acc38..887ecba5c533b48ee8b98705b6d50ddd9ec37fae 100644 --- a/coolamqp/uplink/listener/thread.py +++ b/coolamqp/uplink/listener/thread.py @@ -17,12 +17,12 @@ class ListenerThread(threading.Thread): threading.Thread.__init__(self, name='coolamqp/ListenerThread') self.daemon = True self.terminating = False - self.listener = EpollListener() def terminate(self): self.terminating = True def run(self): + self.listener = EpollListener() while not self.terminating: self.listener.wait(timeout=1) self.listener.shutdown()