Package org.opennms.core.ipc.sink.api
Interface AsyncDispatcher<S extends Message>
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
AsyncDispatcherImpl
public interface AsyncDispatcher<S extends Message> extends java.lang.AutoCloseable
Used to asynchronously dispatch messages. Instances of these should be created by theMessageDispatcherFactory
.- Author:
- jwhite
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AsyncDispatcher.DispatchStatus
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getQueueSize()
Returns the number of messages that are currently queued awaiting for dispatch.java.util.concurrent.CompletableFuture<AsyncDispatcher.DispatchStatus>
send(S message)
Asynchronously send the given message.
-
-
-
Method Detail
-
send
java.util.concurrent.CompletableFuture<AsyncDispatcher.DispatchStatus> send(S message)
Asynchronously send the given message.- Parameters:
message
- the message to send- Returns:
- a future that is resolved once the message was dispatched or queued
-
getQueueSize
int getQueueSize()
Returns the number of messages that are currently queued awaiting for dispatch.- Returns:
- current queue size
-
-