suspendFunction
fun <T, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: Function<T, R>): suspend (T) -> R(source)
Kotlin api:
fun foo(block: suspend (T) -> R) { }
fun bar(block: suspend T.() -> R) { }
Content copied to clipboard
Use it in Java:
foo(Lambdas.suspendFunction(t -> new R()));
bar(Lambdas.suspendFunction(t -> new R()));
Content copied to clipboard
fun <T1, T2, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: BiFunction<T1, T2, R>): suspend (T1, T2) -> R(source)
fun <T1, T2, T3, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: (T1, T2, T3) -> R): suspend (T1, T2, T3) -> R(source)