flush
Drains all entries of a TQueue into a single list.
import arrow.fx.stm.TQueue
import arrow.fx.stm.atomically
suspend fun main() {
//sampleStart
val tq = TQueue.new<Int>()
val result = atomically {
tq.write(2)
tq.write(4)
tq.flush()
}
//sampleEnd
println("Result $result")
println("Items in queue ${atomically { tq.flush() }}")
}
Content copied to clipboard
This function never retries.