Open yangjinhao1234 opened 2 years ago
I see the doc, I know the connection class is the beginning of the aio-pika. but I don't know if the connection is designed to be a reuseable one?
could I make a connection and reuse it anywhere like this ?
class publisher: _instance=None def __new__(cls): if not cls._instance: cls._instance=super().__new__(cls) return cls._instance async def initialize(url): self.__connection=aio-pika.connect(url) @property def connection(): return self.__connection
I see the doc, I know the connection class is the beginning of the aio-pika. but I don't know if the connection is designed to be a reuseable one?
could I make a connection and reuse it anywhere like this ?