'Return the maximum number of messages allowed to be returned.
Returns an estimated number of messages that a consumer may be allowed
to consume at once from the broker.  This is used for services where
bulk \'get message\' calls are preferred to many individual \'get message\'
calls - like SQS.
Returns:
int: greater than zero.'

def can_consume_max_estimate(self):

    pcount = self.prefetch_count
    if pcount:
        return max((pcount - (len(self._delivered) - len(self._dirty))), 0)
