code: def next_batch(self, n=1):
          
          if len(self.queue) == 0:
              return []
          batch = list(reversed((self.queue[-n:])))
          self.queue = self.queue[:-n]
          return batch
docs: Return the next requests that should be dispatched.