Interface Messenger

All Superinterfaces:
AutoCloseable

@OverrideOnly public interface Messenger extends AutoCloseable
Represents an object which dispatches OutgoingMessages.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Performs the necessary action to gracefully shutdown the messenger.
    void
    Performs the necessary action to dispatch the message using the means of the messenger.
  • Method Details

    • sendOutgoingMessage

      void sendOutgoingMessage(@NonNull OutgoingMessage outgoingMessage)
      Performs the necessary action to dispatch the message using the means of the messenger.

      The outgoing message instance is guaranteed to be an instance of one of the interfaces extending Message in the 'api.messenger.message.type' package.

      3rd party implementations are encouraged to implement this method with consideration that new types may be added in the future.

      This call is always made async.

      Parameters:
      outgoingMessage - the outgoing message
    • close

      default void close()
      Performs the necessary action to gracefully shutdown the messenger.
      Specified by:
      close in interface AutoCloseable