Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UnboundedChan ¶
type UnboundedChan[T any] struct { In chan<- T // channel for write Out <-chan T // channel for read // contains filtered or unexported fields }
UnboundedChan unbounded channel
func NewUnboundedChan ¶
func NewUnboundedChan[T any](initCapacity int) UnboundedChan[T]
NewUnboundedChan create a unbounded channel
func (UnboundedChan[T]) BufLen ¶
func (ubc UnboundedChan[T]) BufLen() int
BufLen returns len of the buffer.
func (UnboundedChan[T]) IsEmpty ¶
func (ubc UnboundedChan[T]) IsEmpty() bool
IsEmpty returns true if the container length == 0
func (UnboundedChan[T]) Len ¶
func (ubc UnboundedChan[T]) Len() int
Len returns len of Out plus len of buffer.
func (UnboundedChan[T]) Poll ¶
func (ubc UnboundedChan[T]) Poll() (v T, ok bool)
Poll Retrieves and removes the head of this queue, or returns (nil, false) if this queue is empty.
func (UnboundedChan[T]) Push ¶
func (ubc UnboundedChan[T]) Push(vs ...T)
Push adds items of vs to the tail of queue
Click to show internal directories.
Click to hide internal directories.