queue

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueuedChannel

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

QueuedChannel represents a channel on which queued items can be published without having to worry if the reader has actually consumed existing items first or if there's no way of knowing ahead of time what the ideal channel buffer size should be.

func NewQueuedChannel

func NewQueuedChannel[T any](chanBufferSize, queueCapacity int) *QueuedChannel[T]

func (*QueuedChannel[T]) Close

func (q *QueuedChannel[T]) Close()

func (*QueuedChannel[T]) CloseAndDiscardQueued added in v0.14.0

func (q *QueuedChannel[T]) CloseAndDiscardQueued()

CloseAndDiscardQueued force closes the channel and does not guarantee that the remaining queued items will be read.

func (*QueuedChannel[T]) Enqueue

func (q *QueuedChannel[T]) Enqueue(items ...T) bool

func (*QueuedChannel[T]) GetChannel

func (q *QueuedChannel[T]) GetChannel() <-chan T

Jump to

Keyboard shortcuts

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