queue

package
v1.20.22 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue[T any] struct {
	sync.Mutex
	*QueueConfig[T]
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[T any](c *QueueConfig[T]) *Queue[T]

func (*Queue[T]) Flush

func (q *Queue[T]) Flush() error

func (*Queue[T]) Push

func (q *Queue[T]) Push(item T)

func (*Queue[T]) Run

func (q *Queue[T]) Run()

func (*Queue[T]) Stop

func (q *Queue[T]) Stop() error

type QueueConfig

type QueueConfig[T any] struct {
	Handler       func([]T)
	FlushInterval time.Duration
	FlushCount    int
}

Jump to

Keyboard shortcuts

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