@FlowPreview class PublishSubject<T> : AbstractFlow<T>, SubjectAPI<T>
Multicasts items to any number of collectors when they are ready to receive.
Parameters
PublishSubject()
Multicasts items to any number of collectors when they are ready to receive. |
suspend fun collectSafely(collector: FlowCollector<T>): Unit
Start collecting signals from this PublishSubject. |
|
fun collectorCount(): Int
Returns the current number of collectors. |
|
suspend fun complete(): Unit
Indicate no further items will be emitted |
|
suspend fun emit(value: T): Unit
Emit the value to all current collectors, waiting for each of them to be ready for consuming it. |
|
suspend fun emitError(ex: Throwable): Unit
Throw an error on the consumer side. |
|
fun hasCollectors(): Boolean
Returns true if this PublishSubject has any collectors. |