public class VaadinOnKotlinKt
| Modifier and Type | Method and Description |
|---|---|
static <R> java.util.concurrent.Future<R> |
async(kotlin.jvm.functions.Function0<? extends R> block)
Submits a value-returning task for execution and returns a
Future representing the pending results of the task. The
Future.get method will return the task's result upon
successful completion.
|
static java.util.concurrent.ScheduledFuture<?> |
scheduleAtFixedRate(java.time.Duration initialDelay,
java.time.Duration period,
kotlin.jvm.functions.Function0<kotlin.Unit> command)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the given
period; that is executions will commence after
initialDelay then initialDelay+period, then
initialDelay + 2 * period, and so on. |
public static <R> java.util.concurrent.Future<R> async(kotlin.jvm.functions.Function0<? extends R> block)
Submits a value-returning task for execution and returns a Future representing the pending results of the task. The Future.get method will return the task's result upon successful completion.
If you would like to immediately block waiting
for a task, you can use constructions of the form
result = exec.submit(aCallable).get()
block - the task to submitpublic static java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.time.Duration initialDelay,
java.time.Duration period,
kotlin.jvm.functions.Function0<kotlin.Unit> command)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the given
period; that is executions will commence after
initialDelay then initialDelay+period, then
initialDelay + 2 * period, and so on.
If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
command - the task to executeinitialDelay - the time to delay first execution, in millis. You can use expressions like 5.days + 2.seconds to compute this value.period - the period between successive executions, in millisget() method will throw an
exception upon cancellation