code: def _check_send_batch(self, result=None):
          
          if (
              (self.batch_every_n and self.batch_every_n <= self._waitingMsgCount) or
              (self.batch_every_b and self.batch_every_b <= self._waitingByteCount)
          ):
              self._send_batch()
          return result
docs: Check if we have enough messages/bytes to send
          Since this can be called from the callback chain, we
          pass through our first (non-self) arg