Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinStateFlow SharedFlowSingle-choice MCQ

With a `MutableSharedFlow` configured as below and no active subscribers, how does the call `flow.tryEmit(4)` behave after 1, 2, 3 have already been emitted?

val flow = MutableSharedFlow<Int>( replay = 1, extraBufferCapacity = 2, onBufferOverflow = BufferOverflow.DROP_OLDEST ) // already emitted: 1, 2, 3 val ok = flow.tryEmit(4)