code: def upload(self):
          
          success = False
          batch = self.next()
          if len(batch) == 0:
              return False
  
          try:
              self.request(batch)
              success = True
          except Exception as e:
              self.log.error('error uploading: %s', e)
              success = False
              if self.on_error:
                  self.on_error(e, batch)
          finally:
              # cleanup
              for item in batch:
                  self.queue.task_done()
  
              return success
docs: Upload the next batch of items, return whether successful.