A use case: I’m using a buffered channel to send log messages from a client to a server. Of course, such things can escalate into a DoS scenario with too many log messages being posted and the server being unable to process them at this rate.
So I don’t want to suspend when the buffer is full. Rather, I’ll just drop messages and keep track of that fact, which I’ll then report later when things cool down.
And tryEmit will use the buffer, but it won’t suspend when it’s full.