code: def cancel(self, block=True):
          
          if self._consumer:
              self._consumer.cancel(block=block)
docs: Cancel a call to consume() happening in another thread
  
          This could take up to DashiConnection.consumer_timeout to complete.
  
          @param block: if True, waits until the consumer has returned