code: def unregister_provider(self, provider):
          
          self._unregistering_providers.add(provider)
          remaining_providers = self._providers - self._unregistering_providers
          if not remaining_providers:
              _log.debug('unregistering from queueconsumer %s', self)
              self.queue_consumer.unregister_provider(self)
              _log.debug('unregistered from queueconsumer %s', self)
              self._unregistered_from_queue_consumer.send(True)
  
          _log.debug('waiting for unregister from queue consumer %s', self)
          self._unregistered_from_queue_consumer.wait()
          super(RpcConsumer, self).unregister_provider(provider)
docs: Unregister a provider.
  
          Blocks until this RpcConsumer is unregistered from its QueueConsumer,
          which only happens when all providers have asked to unregister.