code: def get_tasks(self, count):
          
          tasks = []
          for i in range(0, count):
              try:
                  x = self.pending_task_queue.get(block=False)
              except queue.Empty:
                  break
              else:
                  tasks.append(x)
  
          return tasks
docs: Obtains a batch of tasks from the internal pending_task_queue
  
          Parameters
          ----------
          count: int
              Count of tasks to get from the queue
  
          Returns
          -------
          List of upto count tasks. May return fewer than count down to an empty list
              eg. [{'task_id':<x>, 'buffer':<buf>} ... ]