Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultQueueSize = 256
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedQueue ¶
type FixedQueue[T any] struct { // contains filtered or unexported fields }
func NewFixedQueue ¶
NewFixedQueue returns a pointer to a queue whose capacity is the next power of two equal to or greater than n (minimum 2).
func (*FixedQueue[T]) Push ¶
func (q *FixedQueue[T]) Push(v T) bool
Push attempts to push v into the queue. Returns false if the queue is full.
func (*FixedQueue[T]) PushAtomic ¶
func (q *FixedQueue[T]) PushAtomic(v T) PushResult
type MemorySize ¶
type MemorySize interface {
MemoryUsage() uint64
}
type PushResult ¶
type PushResult int
const ( PushFailed PushResult = iota - 1 PushSuccess PushFull )
func (PushResult) IsSuccess ¶
func (r PushResult) IsSuccess() bool
func (PushResult) String ¶
func (r PushResult) String() string
Click to show internal directories.
Click to hide internal directories.