UnicastSubject

class UnicastSubject<T> : AbstractFlow<T> , SubjectAPI<T>

Buffers items until a single collector collects them.

Parameters

the item type

Constructors

UnicastSubject
Link copied to clipboard
fun UnicastSubject()
the item type

Types

Companion
Link copied to clipboard
object Companion

Functions

collect
Link copied to clipboard
suspend override fun collect(collector: FlowCollector<T>)
collectorCancelled
Link copied to clipboard
fun collectorCancelled(): Boolean
collectorCount
Link copied to clipboard
open override fun collectorCount(): Int
Returns the number of collectors waiting for data.
collectSafely
Link copied to clipboard
open suspend override fun collectSafely(collector: FlowCollector<T>)
complete
Link copied to clipboard
open suspend override fun complete()
Indicate no further items will be produced.
emit
Link copied to clipboard
open suspend override fun emit(value: T)
emitError
Link copied to clipboard
open suspend override fun emitError(ex: Throwable)
Signal an Throwable to the collector.
hasCollectors
Link copied to clipboard
open override fun hasCollectors(): Boolean
Returns true if this subject has collectors waiting for data.

Properties

current
Link copied to clipboard
val current: AtomicReference<FlowCollector<T>>
queue
Link copied to clipboard
val queue: ConcurrentLinkedQueue<T>
resumable
Link copied to clipboard
val resumable: Resumable
terminal
Link copied to clipboard
var terminal: Throwable? = null