Class SimpleAsyncMessageDelivery

java.lang.Object
it.tidalwave.messagebus.spi.SimpleAsyncMessageDelivery
All Implemented Interfaces:
MessageDelivery

public class SimpleAsyncMessageDelivery extends Object implements MessageDelivery
An implementation of MessageDelivery that dispatches messages as soon as they are published, each one in a separate task of the Executor of the SimpleMessageBus.
Since:
2.2
Author:
Fabrizio Giudici
  • Constructor Details

    • SimpleAsyncMessageDelivery

      public SimpleAsyncMessageDelivery()
  • Method Details

    • initialize

      public void initialize(@Nonnull SimpleMessageBus messageBusSupport)
      Initializes this object. It is called by the constructor of SimpleMessageBus.
      Specified by:
      initialize in interface MessageDelivery
      Parameters:
      messageBusSupport - the message bus
    • deliverMessage

      public <T> void deliverMessage(@Nonnull Class<T> topic, @Nonnull T message)
      Delivers a message to the listeners.
      Specified by:
      deliverMessage in interface MessageDelivery
      Type Parameters:
      T - the static type of the topic
      Parameters:
      topic - the dynamic type of the topic
      message - the message