utility.ReceiveChannel.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of baku Show documentation
Show all versions of baku Show documentation
helps you focus your REST API back-end on the business logic
package com.github.fluidsonic.baku
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.channels.produce
fun Iterable.toChannel() =
GlobalScope.produce { forEach { send(it) } }
fun CoroutineScope.emptyReceiveChannel() =
produce { }