public class SingleDelaySender extends QueueProcessingThreadSender
QueueProcessingThreadSender
using a single set delay.Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MESSAGE_DELAY
The default message delay, in milliseconds.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
SingleDelaySender(Client client,
String name,
int delay)
Constructs the sending queue.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkReady(String message)
Checks if the message can be sent yet, or at all.
|
static Function<Client.WithManagement,SingleDelaySender> |
getSupplier(int delay)
Gets a delay supplier with a set delay.
|
void |
setDelay(int delay)
Sets the delay for subsequent messages.
|
beginSending, cleanup, getClient, getConsumer, pause, processElement, shutdown
contains, getQueue, queue, run
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, queue
public static final int DEFAULT_MESSAGE_DELAY
public static Function<Client.WithManagement,SingleDelaySender> getSupplier(int delay)
delay
- delay to setprotected boolean checkReady(@Nonnull String message)
QueueProcessingThreadSender
checkReady
in class QueueProcessingThreadSender
message
- the message to be sentpublic void setDelay(int delay)
delay
- the new delayCopyright © 2013–2019 Kitteh. All rights reserved.