public class CompletableFutureInboundDataClient extends java.lang.Object implements InboundDataClient
InboundDataClient backed by a CompletableFuture.| Modifier and Type | Method and 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.
|
public static InboundDataClient create()
CompletableFutureInboundDataClient using a new CompletableFuture.public void awaitCompletion()
throws java.lang.Exception
InboundDataClientawaitCompletion in interface InboundDataClientjava.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.public boolean isDone()
InboundDataClientisDone in interface InboundDataClientpublic void cancel()
InboundDataClientcancel in interface InboundDataClientpublic void complete()
InboundDataClientcomplete in interface InboundDataClientpublic void fail(java.lang.Throwable t)
InboundDataClientfail in interface InboundDataClientt - the throwable that caused this client to fail