- java.lang.Object
-
- com.erudika.para.core.queue.MockQueue
-
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
MockQueue
public MockQueue()
Default constructor.
-
MockQueue
public MockQueue(String name)
- Parameters:
name- name
-
-
Method Detail
-
pull
public String pull()
Description copied from interface:QueuePulls one or more messages from a queue.
-
push
public void push(String task)
Description copied from interface:QueuePushes a message to a queue.
-
getName
public String getName()
Description copied from interface:QueueReturns the name of the queue.
-
setName
public void setName(String name)
Description copied from interface:QueueSets the name of the queue.
-
startPolling
public void startPolling()
Description copied from interface:QueueStart a new async task which polls the queue and automatically processes the messages. This was inspired by Elasticsearch rivers.- Specified by:
startPollingin interfaceQueue
-
stopPolling
public void stopPolling()
Description copied from interface:QueueStops the polling async task manually. This method should always be called on shutdown.- Specified by:
stopPollingin interfaceQueue
-
-