Is there a way to check if a `SharedFlow` that is...
# coroutines
z
Is there a way to check if a
SharedFlow
that is set to
BufferOverflow.DROP_OLDEST
actually drops a value from its buffer due to the buffer being full? I would like to log a warning when this occurs.
t
I think there is no API to hook dropping, but you can use tryEmit to avoid suspend until there is a buffer space available.
A shared flow configured with a BufferOverflow strategy other than SUSPEND (either DROP_OLDEST or DROP_LATEST) never suspends on emit, and thus tryEmit to such a shared flow always returns true.