Let's document a list of "known working patterns" and "known problematic patterns".
One problematic problem is separating the QueueSubResource's context manager and iterator in a loop. For example:
while True:
async with from_clients_queue.open_sub() as sub:
... other stuff that takes a while ...
async for msg in sub:
process(msg)
On RabbitMQ this will raise a ConnectionResetError: [Errno 104] Connection reset by peer error. It could be resolved by increasing the heartbeat timeout (which is controlled by ack_timeout, but this is a complex problem--best to avoid)
Let's document a list of "known working patterns" and "known problematic patterns".
One problematic problem is separating the
QueueSubResource
's context manager and iterator in a loop. For example:On RabbitMQ this will raise a
ConnectionResetError: [Errno 104] Connection reset by peer
error. It could be resolved by increasing the heartbeat timeout (which is controlled byack_timeout
, but this is a complex problem--best to avoid)