-
public final class VaadinOnKotlinKt
-
-
Method Summary
Modifier and Type Method Description final <R extends Any> Future<R>async(Function0<R> block)Submits a value-returning task for execution and returns a Future representing the pending results of the task. final ScheduledFuture<?>scheduleAtFixedRate(Duration initialDelay, Duration period, Function0<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 initialDelaytheninitialDelay+period, theninitialDelay + 2 * period, and so on.-
-
Method Detail
-
async
final <R extends Any> Future<R> async(Function0<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()- Parameters:
block- the task to submit
-
scheduleAtFixedRate
final ScheduledFuture<?> scheduleAtFixedRate(Duration initialDelay, Duration period, Function0<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
initialDelaytheninitialDelay+period, theninitialDelay + 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.
- Parameters:
initialDelay- the time to delay first execution, in millis.period- the period between successive executions, in milliscommand- the task to execute
-
-
-
-