Skip to content

Commit 9d1e860

Browse files
author
Marco Paolini
committed
Collect done coroutine results (or exceptions) in websocket
1 parent 681c7d6 commit 9d1e860

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pushpull/amqp/rpc/driver_aioamqp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def __aenter__(self):
3535
routing_key=app_routing_key
3636
)
3737
send_exchange_name, send_routing_key, reply_to = '', None, None
38-
logger.debug('connected ok')
38+
logger.info('connected with role {} to ok'.format(self.role))
3939
return (
4040
Sender(self._chan, send_exchange_name, send_routing_key, reply_to=reply_to),
4141
Receiver(self._chan, receive_queue_name)

pushpull/websocket/gateway.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ async def websocket_rabbitmq_gateway(request):
4949
)
5050
logger.info('exiting due to done coroutines %r', done)
5151
for coro in pending:
52+
logger.warning('cancelling pending coroutine %r', coro)
5253
coro.cancel()
54+
for coro in done:
55+
result = coro.result()
56+
logger.info('coroutine %r done, result: %r', coro, result)
5357
except Exception:
5458
logger.exception('exception while handling request')
5559
finally:

0 commit comments

Comments
 (0)