newTaskFor

fun <T> newTaskFor(runnable: Runnable, value: T?): RunnableFuture<T>

Returns a RunnableFuture for the given runnable and default value.

Return

a RunnableFuture which, when run, will run the underlying runnable and which, as a Future, will yield the given value as its result and provide for cancellation of the underlying task

Since

1.6

Parameters

runnable

the runnable task being wrapped

value

the default value for the returned future

the type of the given value

fun <T> newTaskFor(callable: Callable<T>): RunnableFuture<T>

Returns a RunnableFuture for the given callable task.

Return

a RunnableFuture which, when run, will call the underlying callable and which, as a Future, will yield the callable's result as its result and provide for cancellation of the underlying task

Since

1.6

Parameters

callable

the callable task being wrapped

the type of the callable's result