Package io.grpc.stub

Class ClientCalls.BlockingResponseStream<T>

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

    private static final class ClientCalls.BlockingResponseStream<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    Convert events on a ClientCall.Listener into a blocking Iterator.

    The class is not thread-safe, but it does permit ClientCall.Listener calls in a separate thread from Iterator calls.

    • Field Detail

      • buffer

        private final java.util.concurrent.BlockingQueue<java.lang.Object> buffer
      • last

        private java.lang.Object last
    • Constructor Detail

      • BlockingResponseStream

        BlockingResponseStream​(ClientCall<?,​T> call)
    • Method Detail

      • waitForNext

        private java.lang.Object waitForNext()
      • 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>
      • remove

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