unboundedchan

package
v1.2.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 1 Imported by: 0

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]) Clear

func (ubc UnboundedChan[T]) Clear()

Clear clears the container

func (UnboundedChan[T]) Close

func (ubc UnboundedChan[T]) Close()

Close Close the In channel

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL