All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fuookami.ospf.kotlin.utils.parallel.ChannelGuard.kt Maven / Gradle / Ivy

There is a newer version: 1.0.29
Show newest version
package fuookami.ospf.kotlin.utils.parallel

import kotlinx.coroutines.channels.*

class ChannelGuard(
    val channel: Channel
) : AutoCloseable {
    override fun close() {
        channel.close()
    }

    operator fun iterator() = channel.iterator()
    suspend fun receive() = channel.receive()
    fun tryReceive() = channel.tryReceive()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy