From e50476620c9dc632e51d4b98d0d33786feb23baf Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Wed, 14 May 2025 18:44:25 -0400 Subject: [PATCH] sequencer: improve Godocs --- sequencer/sequencer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sequencer/sequencer.go b/sequencer/sequencer.go index 8039ece..1a53ad8 100644 --- a/sequencer/sequencer.go +++ b/sequencer/sequencer.go @@ -22,6 +22,8 @@ type seqWriter struct { // Channel[T] is a multi-producer, single-consumer channel of items with monotonicaly-increasing sequence numbers. // Items can be sent in any order, but they are always received in order of their sequence number. +// It is unsafe to call Next concurrently with itself, or to call Add/Reserve concurrently with another Add/Reserve +// call for the same sequence number. Otherwise, methods are safe to call concurrently. type Channel[T any] struct { mu sync.Mutex next uint64