Documentation
¶
Index ¶
Constants ¶
View Source
const ( MinCap = 1 << 7 MaxCap = 1 << 20 )
Variables ¶
View Source
var ErrCollision = errors.New("ring buffer collision, retry later")
View Source
var ErrOverflow = errors.New("ring buffer overflow, retry later after Pop")
Functions ¶
This section is empty.
Types ¶
type Ring ¶
type Ring struct {
// contains filtered or unexported fields
}
Ring is optimal for many writers (go-routines B-n) and a single reader (go-routine A). It is not thread safe for multiple readers.
func New ¶
New creates a new diode (ring buffer). The Ring diode is optimized for many writers (on go-routines B-n) and a single reader (on go-routine A).
ring size = 2 ^ x.
Click to show internal directories.
Click to hide internal directories.