delayqueue

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

delay-queue

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry[T any] struct {
	Body  T
	Delay time.Duration
	// contains filtered or unexported fields
}

type HandleFun

type HandleFun[T any] func(ele *Entry[T])
type LinkList[T any] struct {
	Head *Entry[T]
	Tail *Entry[T]
	sync.Mutex
}

func (*LinkList[T]) Remove

func (ll *LinkList[T]) Remove(node *Entry[T])

type Queue

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

func NewQueue

func NewQueue[T any](fun HandleFun[T], slotNum int) *Queue[T]

func (*Queue[T]) Push

func (q *Queue[T]) Push(delay time.Duration, ele T)

func (*Queue[T]) Run

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

Jump to

Keyboard shortcuts

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