-
- All Known Implementing Classes:
MockQueue
public interface QueueThe core queue interface. Pushes messages to a queue and pulls them for processing.- Author:
- Alex Bogdanovski [alex@erudika.com]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetName()Returns the name of the queue.Stringpull()Pulls one or more messages from a queue.voidpush(String task)Pushes a message to a queue.voidsetName(String name)Sets the name of the queue.voidstartPolling()Start a new async task which polls the queue and automatically processes the messages.voidstopPolling()Stops the polling async task manually.
-
-
-
Method Detail
-
pull
String pull()
Pulls one or more messages from a queue.- Returns:
- the message
-
push
void push(String task)
Pushes a message to a queue.- Parameters:
task- the message
-
getName
String getName()
Returns the name of the queue.- Returns:
- the queue name
-
setName
void setName(String name)
Sets the name of the queue.- Parameters:
name- a name
-
startPolling
void startPolling()
Start a new async task which polls the queue and automatically processes the messages. This was inspired by Elasticsearch rivers.
-
stopPolling
void stopPolling()
Stops the polling async task manually. This method should always be called on shutdown.
-
-