suspendConsumer
fun <T> suspendConsumer(isRunWithInterruptible: Boolean = true, function: Consumer<T>): suspend (T) -> Unit(source)
Kotlin api:
fun foo(block: suspend (T) -> Unit) { }
fun bar(block: suspend T.() -> Unit) { }
Content copied to clipboard
Use it in Java:
foo(Lambdas.suspendConsumer(t -> {}));
bar(Lambdas.suspendConsumer(t -> {}));
Content copied to clipboard
fun <T1, T2> suspendConsumer(isRunWithInterruptible: Boolean = true, function: BiConsumer<T1, T2>): suspend (T1, T2) -> Unit(source)
fun <T1, T2, T3> suspendConsumer(isRunWithInterruptible: Boolean = true, function: Consumer3<T1, T2, T3>): suspend (T1, T2, T3) -> Unit(source)