'Return true if the channel can be consumed from.
Used to ensure the client adhers to currently active
prefetch limits.'

def can_consume(self):

    pcount = self.prefetch_count
    return ((not pcount) or ((len(self._delivered) - len(self._dirty)) < pcount))
