Class MultiQueue

java.lang.Object
it.tidalwave.messagebus.spi.MultiQueue

public class MultiQueue extends Object
Author:
Fabrizio Giudici
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    add(Class<T> topic, T message)
    Adds a message of the given topic to this queue and issues a notification.
    <T> it.tidalwave.messagebus.spi.MultiQueue.TopicAndMessage<T>
    Removes and returns the next pair (topic, message) from the queue.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MultiQueue

      public MultiQueue()
  • Method Details

    • add

      public <T> void add(@Nonnull Class<T> topic, @Nonnull T message)
      Adds a message of the given topic to this queue and issues a notification.
      Type Parameters:
      T - the static type of the message
      Parameters:
      topic - the dynamic type of the message
      message - the message
    • remove

      @Nonnull public <T> it.tidalwave.messagebus.spi.MultiQueue.TopicAndMessage<T> remove() throws InterruptedException
      Removes and returns the next pair (topic, message) from the queue. Blocks until one is available.
      Type Parameters:
      T - the static type of the topic
      Returns:
      the topic and message
      Throws:
      InterruptedException - if interrupted while waiting