Package it.tidalwave.messagebus.spi
Class MultiQueue
java.lang.Object
it.tidalwave.messagebus.spi.MultiQueue
- Author:
- Fabrizio Giudici
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MultiQueue
public MultiQueue()
-
-
Method Details
-
add
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 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:
InterruptedException
- if interrupted while waiting
-