interface SubjectAPI<T> : FlowCollector<T>
Base interface for suspendable push signals emit, emitError and complete.
abstract fun collectorCount(): Int
Returns the number of collectors waiting for data. |
|
abstract suspend fun complete(): Unit
Indicate no further items will be produced. |
|
abstract suspend fun emitError(ex: Throwable): Unit
Signal an Throwable to the collector. |
|
abstract fun hasCollectors(): Boolean
Returns true if this subject has collectors waiting for data. |
class BehaviorSubject<T> : AbstractFlow<T>, SubjectAPI<T>
Caches one item and replays it to fresh collectors. |
|
class PublishSubject<T> : AbstractFlow<T>, SubjectAPI<T>
Multicasts items to any number of collectors when they are ready to receive. |
|
class ReplaySubject<T> : AbstractFlow<T>, SubjectAPI<T>
Caches and replays some or all items to collectors. |