readScope

abstract suspend fun <R> readScope(block: suspend ReadScope<T>.(locked: Boolean) -> R): R(source)

Creates a scope for reading to allow storage reads, and will try to obtain a read lock.

Parameters

block

The block of code that is performed within this scope. Block will receive locked parameter which is true if the try lock succeeded.

Throws

when there is an unrecoverable exception in reading.