We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d3771f commit 379916dCopy full SHA for 379916d
1 file changed
ringchan.go
@@ -3,6 +3,9 @@ package ringchan
3
type Ring[T any] struct {
4
// C is the channel to receive values from.
5
C <-chan T
6
+
7
+ // Number of dropped items due to full buffer.
8
+ Dropped int
9
}
10
11
// New creates a ring-buffered channel with fixed capacity from incoming channel.
@@ -29,6 +32,7 @@ func New[T any](in <-chan T, size int) *Ring[T] {
29
32
default:
30
33
out <- v
31
34
35
+ rc.Dropped++
36
37
38
}()
0 commit comments