public class AsyncDispatcherImpl<W,S extends Message,T extends Message> extends Object implements AsyncDispatcher<S>
Constructor and Description |
---|
AsyncDispatcherImpl(DispatcherState<W,S,T> state,
AsyncPolicy asyncPolicy,
SyncDispatcher<S> syncDispatcher) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getQueueSize()
Returns the number of messages that are currently queued
awaiting for dispatch.
|
CompletableFuture<S> |
send(S message)
Asynchronously send the given message and return a future
that is resolved once the message was successfully dispatched.
|
public AsyncDispatcherImpl(DispatcherState<W,S,T> state, AsyncPolicy asyncPolicy, SyncDispatcher<S> syncDispatcher)
public CompletableFuture<S> send(S message)
AsyncDispatcher
send
in interface AsyncDispatcher<S extends Message>
message
- the message to sendpublic int getQueueSize()
AsyncDispatcher
getQueueSize
in interface AsyncDispatcher<S extends Message>
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2018. All rights reserved.