Hi, I'm new to the flows, so need some guidance or the directions where to find the information regarding some issue I have.
I have a peace of code, which do send over the sockets some data. Technically I was forced to create a dedicated channel/MutableSharedFlow for the messages I'd like to send. My app generates the messages non-stop without delays (for the test purposes) and pushes them into this dedicated channel/MutableSharedFlow. It works about 5000M messages in the row, and then it looks like MutableSharedFlow stops handling the messages, so I can see in debug, where I emit the message, that MutableSharedFlow is not closed and able to emit, but the place (other coroutine) where I .onEach {} .collect() them - never receive any messages anymore after ~5000M handled messages, with the channel it's around 2000M messages.
The channel was configured like:
protected val channel: Channel<KZOut> = Channel(1000, BufferOverflow.DROP_OLDEST) {
logger.error { "Undelivered: $it" }
}
The flow was configured like:
protected val _events = MutableSharedFlow<KZOut>(onBufferOverflow = BufferOverflow.DROP_OLDEST, extraBufferCapacity = 1000)
protected val events = _events.asSharedFlow() // read-only public view
I switched to the flow after the problems with the channel, but flow stops also. The main problem is - there is no any error message, why it happens, my log is clear. 😞