Class BlockingAsyncIterator<T>

  • All Implemented Interfaces:
    java.util.Iterator<T>

    @ThreadSafe
    public class BlockingAsyncIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    This class is a wrapper over async iterator that implements java.util.Iterator interface. This is blocking wrapper on async iterator's getNext method which implements blocking hasNext and next methods of iterator interface. This class is threadsafe but that has the drawback of blocking on asyncIterator's getNext within a lock.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      T next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • BlockingAsyncIterator

        public BlockingAsyncIterator​(AsyncIterator<T> asyncIterator)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>