dchannel

package
v0.0.0-...-17853a9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsOutputChannel

func AsOutputChannel[T any](
	ch *DynamicChannel[T],
) (chan T, func(context.Context))

Types

type DynamicChannel

type DynamicChannel[T any] struct {
	// contains filtered or unexported fields
}

TODO: Need to find a way to use Deque[claim] instead of Deque[*claim]

func New

func New[T any]() *DynamicChannel[T]

func NewWithMutex

func NewWithMutex[T any](mx *sync.RWMutex) *DynamicChannel[T]

func (*DynamicChannel[T]) Dequeue

func (dch *DynamicChannel[T]) Dequeue(ctx context.Context) (*T, error)

func (*DynamicChannel[T]) DequeueNonblock

func (dch *DynamicChannel[T]) DequeueNonblock() *T

func (*DynamicChannel[T]) Enqueue

func (dch *DynamicChannel[T]) Enqueue(ctx context.Context, d T) error

func (*DynamicChannel[T]) EnqueueNonblock

func (dch *DynamicChannel[T]) EnqueueNonblock(d T)

func (*DynamicChannel[T]) Peek

func (dch *DynamicChannel[T]) Peek() *T

func (*DynamicChannel[T]) Size

func (dch *DynamicChannel[T]) Size() int

func (*DynamicChannel[T]) Slice

func (dch *DynamicChannel[T]) Slice() []T

Jump to

Keyboard shortcuts

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