Immutable

class Immutable(val permitsStateFlow: StateFlow<Int>) : SmartSemaphore(source)

Immutable variant of SmartSemaphore. In fact will depend on the owner of permitsStateFlow

Constructors

Link copied to clipboard
constructor(permitsStateFlow: StateFlow<Int>)

Properties

Link copied to clipboard
open val freePermits: Int
Link copied to clipboard
open override val permitsStateFlow: StateFlow<Int>

Functions

Link copied to clipboard
suspend fun SmartSemaphore.waitRelease(permits: Int = 1): Int

Will wait until the SmartSemaphore.permitsStateFlow of this instance will have permits count free permits.