code: def next(self):
          
          # Block until a document is returnable.
          while self.alive:
              doc = self._try_next(True)
              if doc is not None:
                  return doc
  
          raise StopIteration
docs: Advance the cursor.