@MissingDocumentation @ExtensionClass public class Async extends java.lang.Object
| Constructor and Description |
|---|
Async() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Thread |
current() |
static <T> java.util.concurrent.Future<T> |
future(java.util.concurrent.Callable<T> callable) |
static <T> java.util.concurrent.Future<T> |
future(java.lang.String task,
java.util.concurrent.Callable<T> callable) |
static void |
sleep(int milis) |
static void |
task(java.lang.String task,
java.util.function.Consumer<java.util.concurrent.ScheduledExecutorService> scheduled,
int everySeconds)
Start an Async single thread task every x seconds.
|
static void |
task(java.lang.String task,
java.lang.Runnable scheduled,
int everySeconds)
Start an Async single thread task every x seconds.
|
static java.lang.Thread |
thread(int sleepMilis,
java.lang.Runnable doAfter) |
static java.lang.Thread |
thread(java.lang.Runnable doAsync)
Creates a thread with a Runnable and immediately starts the Thread
|
static java.lang.Thread |
thread(java.lang.String name,
int sleepMilis,
java.lang.Runnable doAfter) |
static java.lang.Thread |
thread(java.lang.String name,
java.lang.Runnable doAsync)
Creates a thread with a Runnable and immediately starts the Thread
|
public static java.lang.Thread current()
public static <T> java.util.concurrent.Future<T> future(java.lang.String task,
java.util.concurrent.Callable<T> callable)
public static <T> java.util.concurrent.Future<T> future(java.util.concurrent.Callable<T> callable)
public static void sleep(int milis)
public static void task(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 task(java.lang.String task,
java.util.function.Consumer<java.util.concurrent.ScheduledExecutorService> scheduled,
int everySeconds)
task - The name of the task to runscheduled - The consumer that accepts the Executor as parameter.everySeconds - the amount of seconds the task will take to loop.public static java.lang.Thread thread(java.lang.Runnable doAsync)
doAsync - the Runnable that the thread will runpublic static java.lang.Thread thread(int sleepMilis,
java.lang.Runnable doAfter)
public static java.lang.Thread thread(java.lang.String name,
int sleepMilis,
java.lang.Runnable doAfter)
public static java.lang.Thread thread(java.lang.String name,
java.lang.Runnable doAsync)
name - The thread namedoAsync - The Runnable that the thread will run