I would like to check if a Consumer/Worker is present to consume a Message I am about to send.
If there isn\'t any Worker, I would start s
I was just looking into this as well. After reading through the source and docs I came across the following in channel.py:
@property
def consumer_tags(self):
"""Property method that returns a list of currently active consumers
:rtype: list
"""
return self._consumers.keys()
My own testing was successful. I used the following where my channel object is self._channel:
if len(self._channel.consumer_tags) == 0:
LOGGER.info("Nobody is listening. I'll come back in a couple of minutes.")
...