Skip to content
Snippets Groups Projects
Commit cecf5840 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fixes #23

parent 558e8a75
No related branches found
No related tags found
No related merge requests found
...@@ -151,6 +151,7 @@ class Publisher(Channeler, Synchronized): ...@@ -151,6 +151,7 @@ class Publisher(Channeler, Synchronized):
""" """
assert self.state == ST_ONLINE assert self.state == ST_ONLINE
assert self.mode == Publisher.MODE_CNPUB assert self.mode == Publisher.MODE_CNPUB
assert self.tagger is not None
while len(self.messages) > 0: while len(self.messages) > 0:
try: try:
...@@ -265,20 +266,17 @@ class Publisher(Channeler, Synchronized): ...@@ -265,20 +266,17 @@ class Publisher(Channeler, Synchronized):
self.state = ST_ONLINE self.state = ST_ONLINE
self.on_operational(True) self.on_operational(True)
elif self.mode == Publisher.MODE_CNPUB: elif (self.mode == Publisher.MODE_CNPUB) and isinstance(payload, ConfirmSelectOk):
# Because only in this case it makes sense to check for MODE_CNPUB # Because only in this case it makes sense to check for MODE_CNPUB
# A-OK! Boot it.
if isinstance(payload, ConfirmSelectOk): self.tagger = AtomicTagger()
# A-OK! Boot it. self.state = ST_ONLINE
self.state = ST_ONLINE self.on_operational(True)
self.on_operational(True)
# now we need to listen for BasicAck and BasicNack
self.tagger = AtomicTagger()
mw = MethodWatch(self.channel_id, (BasicAck, BasicNack),
# now we need to listen for BasicAck and BasicNack self._on_cnpub_delivery)
mw.oneshot = False
mw = MethodWatch(self.channel_id, (BasicAck, BasicNack), self.connection.watch(mw)
self._on_cnpub_delivery) self._mode_cnpub_process_deliveries()
mw.oneshot = False
self.connection.watch(mw)
self._mode_cnpub_process_deliveries()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment