| Package | Description |
|---|---|
| me.lucko.helper | |
| me.lucko.helper.promise | |
| me.lucko.helper.scheduler |
| Modifier and Type | Method and Description |
|---|---|
static <T> Promise<T> |
Scheduler.call(ThreadContext context,
Callable<T> callable)
Call a callable
|
static <T> Promise<T> |
Scheduler.callLater(ThreadContext context,
Callable<T> callable,
long delay)
Call a callable at some point in the future
|
static <T> Consumer<T> |
Scheduler.consuming(ThreadContext context,
Consumer<? super T> action)
Returns a consumer which when supplied, will delegate calls to the given
consumer (a)synchronously.
|
static Promise<Void> |
Scheduler.run(ThreadContext context,
Runnable runnable)
Execute a runnable
|
static Promise<Void> |
Scheduler.runLater(ThreadContext context,
Runnable runnable,
long delay)
Execute a runnable at some point in the future
|
static Scheduler.Task |
Scheduler.runTaskRepeating(ThreadContext context,
Consumer<Scheduler.Task> consumer,
long delay,
long interval)
Schedule a repeating task to run
|
static Scheduler.Task |
Scheduler.runTaskRepeating(ThreadContext context,
Runnable runnable,
long delay,
long interval)
Schedule a repeating task to run
|
static <T> Promise<T> |
Scheduler.supply(ThreadContext context,
Supplier<T> supplier)
Compute the result of the passed supplier
|
static <T> Promise<T> |
Scheduler.supplyLater(ThreadContext context,
Supplier<T> supplier,
long delay)
Compute the result of the passed supplier at some point in the future
|
| Modifier and Type | Method and Description |
|---|---|
static ThreadContext |
ThreadContext.forCurrentThread() |
static ThreadContext |
ThreadContext.forThread(Thread thread) |
static ThreadContext |
ThreadContext.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ThreadContext[] |
ThreadContext.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
default Promise<V> |
Promise.exceptionally(ThreadContext context,
Function<Throwable,? extends V> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function.
|
default Promise<V> |
Promise.exceptionallyDelayed(ThreadContext context,
Function<Throwable,? extends V> fn,
long delay)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function, after the delay has elapsed.
|
default Promise<V> |
Promise.supply(ThreadContext context,
Supplier<V> supplier)
Schedules the supply of the Promise's result, via the given supplier.
|
default Promise<V> |
Promise.supplyDelayed(ThreadContext context,
Supplier<V> supplier,
long delay)
Schedules the supply of the Promise's result, via the given supplier,
after the delay has elapsed.
|
static <U> Promise<U> |
Promise.supplying(ThreadContext context,
Supplier<U> supplier)
Returns a new Promise, and schedules it's population via the given supplier.
|
static <U> Promise<U> |
Promise.supplyingDelayed(ThreadContext context,
Supplier<U> supplier,
long delay)
Returns a new Promise, and schedules it's population via the given supplier,
after the delay has elapsed.
|
default Promise<Void> |
Promise.thenAccept(ThreadContext context,
Consumer<? super V> action)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action.
|
default Promise<Void> |
Promise.thenAcceptDelayed(ThreadContext context,
Consumer<? super V> action,
long delay)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action, after the delay has elapsed.
|
default <U> Promise<U> |
Promise.thenApply(ThreadContext context,
Function<? super V,? extends U> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
default <U> Promise<U> |
Promise.thenApplyDelayed(ThreadContext context,
Function<? super V,? extends U> fn,
long delay)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
default <U> Promise<U> |
Promise.thenCompose(ThreadContext context,
Function<? super V,? extends Promise<U>> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
default <U> Promise<U> |
Promise.thenComposeDelayedSync(ThreadContext context,
Function<? super V,? extends Promise<U>> fn,
long delay)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
default Promise<Void> |
Promise.thenRun(ThreadContext context,
Runnable action)
Returns a new Promise that, when this promise completes normally, executes
the given task.
|
default Promise<Void> |
Promise.thenRunDelayed(ThreadContext context,
Runnable action,
long delay)
Returns a new Promise that, when this promise completes normally, executes
the given task, after the delay has elapsed.
|
| Modifier and Type | Method and Description |
|---|---|
default TaskBuilder.ThreadContextual |
TaskBuilder.on(ThreadContext context)
Defines the thread context of the new task,
and returns the next builder in the chain.
|
Copyright © 2017. All rights reserved.