Documentation ¶
Index ¶
- type CTQueue
- func (ctq *CTQueue[T]) Apply(fn func(T))
- func (ctq *CTQueue[T]) Close()
- func (ctq *CTQueue[T]) CloseAndRetrieveRemaining() []T
- func (ctq *CTQueue[T]) IsClosed() bool
- func (ctq *CTQueue[T]) Len() int
- func (ctq *CTQueue[T]) Pop() (T, bool)
- func (ctq *CTQueue[T]) Push(val T) bool
- func (ctq *CTQueue[T]) PushMany(val ...T) bool
- func (ctq *CTQueue[T]) TryPop() (T, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CTQueue ¶
type CTQueue[T any] struct { // contains filtered or unexported fields }
CTQueue is a thread safe queue implementation which allows safe usage among different threads/go-routines and can be closed at any given time. The queue can be closed by either allowing the remaining elements to remain within or to be extracted. Once the queue is closed, no new elements may be added, but existing elements can still be popped of the queue.
func NewCTQueue ¶
func (*CTQueue[T]) Apply ¶
func (ctq *CTQueue[T]) Apply(fn func(T))
Apply applies the given function to all items in the queue.
func (*CTQueue[T]) CloseAndRetrieveRemaining ¶
func (ctq *CTQueue[T]) CloseAndRetrieveRemaining() []T
Click to show internal directories.
Click to hide internal directories.