writeScope

abstract suspend fun writeScope(block: suspend WriteScope<T>.() -> Unit)(source)

Creates an write scope that guaranteed to only have one single writer, ensuring also that any reads within this scope have the most current data.

Throws

when there is an unrecoverable exception in writing.