package
Version:
v1.14.0
Opens a new window with list of versions in this module.
Published: Feb 5, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Ring Buffer
Design
1 item
in |out | w | r
----+----+----+----
0 | 0 | 0 | 0
1 | 0 | 1 | 0
1 | 1 | 1 | 1
Documentation
¶
Package ringbuf provides ring buffer.
type Buffer[T any] struct {
}
Buffer provides ring buffer.
New creates a ring buffer with specified capacity.
Empty checks the buffer is empty or not.
Len returns number of valid items in the ringbuf
Peek peeks checks a n'th value in ringbuf without removing the value.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.