Class CompletableFutureInboundDataClient

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void awaitCompletion()
      Block until the client has completed reading from the inbound stream.
      void cancel()
      Cancels the client, causing it to drop any future inbound data.
      void complete()
      Mark the client as completed.
      static InboundDataClient create()
      Create a new CompletableFutureInboundDataClient using a new CompletableFuture.
      void fail​(java.lang.Throwable t)
      Mark the client as completed with an exception.
      boolean isDone()
      Returns true if the client is done, either via completing successfully or by being cancelled.
      void runWhenComplete​(java.lang.Runnable completeRunnable)
      Runs the runnable once the client has completed reading from the inbound stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • awaitCompletion

        public void awaitCompletion()
                             throws java.lang.Exception
        Description copied from interface: InboundDataClient
        Block until the client has completed reading from the inbound stream.
        Specified by:
        awaitCompletion in interface InboundDataClient
        Throws:
        java.lang.InterruptedException - if the client is interrupted before completing.
        java.util.concurrent.CancellationException - if the client is cancelled before completing.
        java.lang.Exception - if the client throws an exception while awaiting completion.
      • runWhenComplete

        public void runWhenComplete​(java.lang.Runnable completeRunnable)
        Description copied from interface: InboundDataClient
        Runs the runnable once the client has completed reading from the inbound stream.
        Specified by:
        runWhenComplete in interface InboundDataClient
      • isDone

        public boolean isDone()
        Description copied from interface: InboundDataClient
        Returns true if the client is done, either via completing successfully or by being cancelled.
        Specified by:
        isDone in interface InboundDataClient
      • cancel

        public void cancel()
        Description copied from interface: InboundDataClient
        Cancels the client, causing it to drop any future inbound data.
        Specified by:
        cancel in interface InboundDataClient
      • fail

        public void fail​(java.lang.Throwable t)
        Description copied from interface: InboundDataClient
        Mark the client as completed with an exception. Calls to awaitCompletion will terminate by throwing the provided exception.
        Specified by:
        fail in interface InboundDataClient
        Parameters:
        t - the throwable that caused this client to fail