invoke

operator fun invoke(scope: CoroutineScope, permits: Int, leaseTime: Duration? = null): AsyncSemaphore<Int>

Returns an instance of an AsyncSemaphore with the specified number of permits.

Return

An AsyncSemaphore instance with the specified number of permits.

Parameters

scope

The number of permits this semaphore can provide.

permits

The number of permits this semaphore can provide.