-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Description
Technically, connection or channel pool can reconnect itself.
However, sometime channel can be closed for several issues.
async with channel_pool.acquire() as channel:
queue = await channel.declare_queue('queue_name', arguments={**kwargs}, passive=True)
If queue doesn't exist or precondition failed, channel will be closed as a result. We can't use this channel and pool can't reconnect too.
The pool still keep this item, we can overwrite put method :
class ChannelPool(Pool):
def put(self, item):
if hasattr(item, 'is_closed') and item.is_closed:
return
super().put(item)
The problem is there is no way to remove in __item_set and __created variable. Name mangling can be work but not recommend.
Since __created = max_size, it won't create new item anymore.
Metadata
Metadata
Assignees
Labels
No labels