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(@NonNull Client client,
@NonNull String name,
int delay)
Constructs the sending queue.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkReady(@NonNull 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 of milliseconds.
|
void |
setDelay(int delay)
Sets the delay for subsequent messages.
|
beginSending, cleanup, getClient, getConsumer, pause, processElement, shutdowncontains, getQueue, queue, runactiveCount, 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, yieldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, queuepublic static final int DEFAULT_MESSAGE_DELAY
public static Function<Client.WithManagement,SingleDelaySender> getSupplier(int delay)
delay - delay to set in millisecondsprotected boolean checkReady(@NonNull String message)
QueueProcessingThreadSendercheckReady in class QueueProcessingThreadSendermessage - the message to be sentpublic void setDelay(int delay)
delay - the new delay in millisecondsCopyright © 2013–2021 Kitteh. All rights reserved.