Class ResponseQueue<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    ResponseHandler<T>

    public class ResponseQueue<T>
    extends java.lang.Object
    implements ResponseHandler<T>
    ResponseQueue is an asynchronous queue.
    • Constructor Detail

      • ResponseQueue

        public ResponseQueue()
    • Method Detail

      • responseValue

        public void responseValue​(Response<T> r,
                                  T value)
        Description copied from interface: ResponseHandler
        Invoked when a response arrives.
        Specified by:
        responseValue in interface ResponseHandler<T>
        Parameters:
        r - The response object which issues the event
        value - The value of the response.
      • responseException

        public void responseException​(Response<T> r,
                                      java.lang.Exception e)
        Description copied from interface: ResponseHandler
        Invoked when a command resulted in an exception.
        Specified by:
        responseException in interface ResponseHandler<T>
        Parameters:
        r - The response object which issues the event
        e - The exception.
      • resultsPending

        public int resultsPending()
      • queueSize

        public int queueSize()
      • poll

        public Response<T> poll​(long timeout,
                                java.util.concurrent.TimeUnit unit)
                         throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • take

        public Response<T> take()
                         throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException