public class Async
extends java.lang.Object
| Constructor and Description |
|---|
Async() |
| Modifier and Type | Method and Description |
|---|---|
static void |
sleep(int milis) |
static void |
startAsyncTask(java.lang.String task,
java.util.function.Consumer<java.util.concurrent.ScheduledExecutorService> scheduled,
int everySeconds) |
static void |
startAsyncTask(java.lang.String task,
java.lang.Runnable scheduled,
int everySeconds)
Start an Async single thread task every x seconds.
|
static java.lang.Runnable |
thread(int sleepMilis,
java.lang.Runnable doAfter) |
static java.lang.Runnable |
thread(java.lang.String name,
java.lang.Runnable doAsync) |
public static void sleep(int milis)
public static void startAsyncTask(java.lang.String task,
java.lang.Runnable scheduled,
int everySeconds)
task - The name of the task to runscheduled - The runnable.everySeconds - the amount of seconds the task will take to loop.public static void startAsyncTask(java.lang.String task,
java.util.function.Consumer<java.util.concurrent.ScheduledExecutorService> scheduled,
int everySeconds)
public static java.lang.Runnable thread(int sleepMilis,
java.lang.Runnable doAfter)
public static java.lang.Runnable thread(java.lang.String name,
java.lang.Runnable doAsync)