Class GrpcChannel.Call<Q,R>

java.lang.Object
com.codename1.backend.grpc.GrpcChannel.Call<Q,R>
Type Parameters:
Q - request type
R - response type
All Implemented Interfaces:
Iterator<R>
Enclosing class:
GrpcChannel

public static final class GrpcChannel.Call<Q,R> extends Object implements Iterator<R>
One call in progress: send requests, end them, read responses.
  • Method Details

    • send

      public void send(Q request)
      Sends one request message.
      Parameters:
      request - the message
    • complete

      public void complete()
      Ends the request stream.
    • close

      public void close()
      Cancels the call when it has not ended, and releases it.
    • getHeaders

      public Map<String,String> getHeaders()
      Returns:
      the response headers, waiting for them
    • getTrailers

      public Map<String,String> getTrailers()
      Returns:
      the trailers, once the responses were read to their end; null before
    • hasNext

      public boolean hasNext()
      Description copied from interface: Iterator

      Returns whether there are more elements to iterate, i.e. whether the iterator is positioned in front of an element.

      Returns

      true if there are more elements, false otherwise.

      See also
      • #next
      Specified by:
      hasNext in interface Iterator<Q>
    • next

      public R next()
      Description copied from interface: Iterator

      Returns the next object in the iteration, i.e. returns the element in front of the iterator and advances the iterator by one position.

      Returns

      the next object.

      Throws
      • NoSuchElementException: if there are no more elements.
      See also
      • #hasNext
      Specified by:
      next in interface Iterator<Q>
    • remove

      public void remove()
      Description copied from interface: Iterator

      Removes the last element next answered from the collection being iterated, which this iterator does not support unless it says otherwise.

      Throws
      • UnsupportedOperationException: when removing is not supported

      • IllegalStateException: when next has not been called, or remove has already been called after the last call to next

      Specified by:
      remove in interface Iterator<Q>