<init>

ConflatedBroadcastChannel(value: E)

Platform and version requirements: JVM

Creates an instance of this class that already holds a value.

It is as a shortcut to creating an instance with a default constructor and immediately sending an element: ConflatedBroadcastChannel().apply { offer(value) }.

ConflatedBroadcastChannel()

Platform and version requirements: JVM

Broadcasts the most recently sent element (aka value) to all openSubscription subscribers.

Back-to-send sent elements are conflated – only the the most recently sent value is received, while previously sent elements are lost. Every subscriber immediately receives the most recently sent element. Sender to this broadcast channel never suspends and offer always returns true.

A secondary constructor can be used to create an instance of this class that already holds a value. This channel is also created by BroadcastChannel(Channel.CONFLATED) factory function invocation.

This implementation is fully lock-free. In this implementation opening and closing subscription takes O(N) time, where N is the number of subscribers.