open fun <A> TQueue<A>.writeFront(a: A)(source)

Prepend an element to the TQueue.

import arrow.fx.stm.TQueue
import arrow.fx.stm.atomically

suspend fun main() {
val tq = TQueue.new<Int>()
atomically {
println("Items in queue ${atomically { tq.flush() }}")

Mainly used to implement TQueue.peek and since this writes to the read variable of a TQueue excessive use can lead to contention on consumers. Prefer appending to a TQueue if possible.

This function never retries.