Fork me on GitHub

I have a consumer that can’t always keep up with a producer, so I put a sliding-buffer (size 1) in between them, and for this application it’s not the end of the world to drop messages. However, I’d really like to know how many messages are being dropped. Does anyone have a recipe for this, or should I deftype my own impl/Buffer that keeps a count of drops?


@aiba: is keeping up two counters a viable alternative for your use-case? Counting messages before/after they pass through the buffer at least could sidestep the need to do something more exotic like implementing your own buffer