kotlinx.coroutines.flow.Flow
kotlinx.coroutines.flow.FlowCollector
public final class Tube<T extends Object> implements Flow<T>, FlowCollector<T>
A synchronous data stream that emits values and completes normally.
Tube()
Unit
collect(FlowCollector<T> collector)
emit(T value)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Unit collect(FlowCollector<T> collector)
Adds the given collector into collectors and suspends until cancellation.
This method is thread-safe and can be safely invoked from concurrent coroutines without external synchronization.
Unit emit(T value)
Emits a value to the collectors, suspending until the value is fully consumed.