arrow-fx / arrow.fx / Semaphore / invoke
operator fun <F> invoke(n: Long, CF: Concurrent<F>): Kind<F, Semaphore<F>>
Construct a Semaphore initialized with n available permits.
import arrow.fx.*
import arrow.fx.extensions.io.concurrent.concurrent
fun main(args: Array<String>) {
//sampleStart
val semaphore = Semaphore<ForIO>(5, IO.concurrent())
//sampleEnd
}
Do you like Arrow?
✖