def cancel(self, queue):
        """
        Cancel the consumer for a queue.

        This removes the consumer from the list of consumers to be configured for
        every connection.

        Args:
            queue (str): The name of the queue the consumer is subscribed to.
        Returns:
            defer.Deferred or None: Either a Deferred that fires when the consumer
                is canceled, or None if the consumer was already canceled. Wrap
                the call in :func:`defer.maybeDeferred` to always receive a Deferred.
        """
        try:
            del self.consumers[queue]
        except KeyError:
            pass
        if self.client:
            return self.client.cancel(queue)
Cancel the consumer for a queue.

        This removes the consumer from the list of consumers to be configured for
        every connection.

        Args:
            queue (str): The name of the queue the consumer is subscribed to.
        Returns:
            defer.Deferred or None: Either a Deferred that fires when the consumer
                is canceled, or None if the consumer was already canceled. Wrap
                the call in :func:`defer.maybeDeferred` to always receive a Deferred.