Package org.opennms.core.ipc.sink.api
Interface AsyncDispatcher<S extends Message>
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AsyncDispatcherImpl
public interface AsyncDispatcher<S extends Message> extends 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.CompletableFuture<AsyncDispatcher.DispatchStatus>
send(S message)
Asynchronously send the given message.-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
send
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
-
-