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 the MessageDispatcherFactory.
    Author:
    jwhite
    • 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