code: def cancel(self):
          
          if self.channel_open:
              try:
                  self.backend.cancel(self.consumer_tag)
              except KeyError:
                  pass
docs: Cancel a running :meth:`iterconsume` session.