Hi Everyone! Just looking into using a `SharedFlow...
# flow
p
Hi Everyone! Just looking into using a
SharedFlow
in our backend application. We're receiving updates and are publishing these on the
SharedFlow
. This works great because it very easy to understand workflow. However, we would like to implement metrics around this. Specifically the SharedFlow has a predefined buffer, and we'd like to be aware of when it is filling up. We can detect when the buffer is full, because the
tryEmit
returns
false
. Is there any way for us to get an early warning here, in case of a slow consumer? It looks like we can check the number of consumers on the flow, but there is no way to check the buffer status. Has anyone got any ideas how to monitor this?
r
I don't have an answer, but I've wondered the same thing. You might have more luck in #coroutines, it's higher traffic
p
we can do tracking and tracing within coroutines, it's just the specific case of the
SharedFlow
that I'm not sure about.
r
Yeah, but that channel tends to answer questions about Flows as well, and has ~10x the members
p
ah right, sorry I misread your message, you were talking about the channel, I thought you meant I should use coroutines
I need more coffee 😄