Package it.tidalwave.messagebus.spi
Class MultiQueue
- java.lang.Object
-
- it.tidalwave.messagebus.spi.MultiQueue
-
public class MultiQueue extends java.lang.Object- Author:
- Fabrizio Giudici
-
-
Constructor Summary
Constructors Constructor Description MultiQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidadd(java.lang.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>remove()Removes and returns the next pair (topic, message) from the queue.
-
-
-
Method Detail
-
add
public <T> void add(@Nonnull java.lang.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 messagemessage- the message
-
remove
@Nonnull public <T> it.tidalwave.messagebus.spi.MultiQueue.TopicAndMessage<T> remove() throws java.lang.InterruptedExceptionRemoves 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:
java.lang.InterruptedException- if interrupted while waiting
-
-