timing

package module
v0.0.0-...-a8a18e3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job[Key comparable, Value any] struct {
	// contains filtered or unexported fields
}

type Jobs

type Jobs[Key comparable, Value any] struct {
	// contains filtered or unexported fields
}

func (*Jobs[Key, Value]) Delete

func (jobs *Jobs[Key, Value]) Delete(key Key)

func (Jobs[Key, Value]) Len

func (jobs Jobs[Key, Value]) Len() int

func (Jobs[Key, Value]) Less

func (jobs Jobs[Key, Value]) Less(i, j int) bool

func (*Jobs[Key, Value]) Pop

func (jobs *Jobs[Key, Value]) Pop() any

func (*Jobs[Key, Value]) Push

func (jobs *Jobs[Key, Value]) Push(x any)

func (Jobs[Key, Value]) Swap

func (jobs Jobs[Key, Value]) Swap(i, j int)

func (*Jobs[Key, Value]) UpdateDeadline

func (jobs *Jobs[Key, Value]) UpdateDeadline(key Key, deadline time.Duration)

type Queue

type Queue[Key comparable, Value any] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[Key comparable, Value any](exec func(Key, Value)) *Queue[Key, Value]

func (*Queue[Key, Value]) Add

func (q *Queue[Key, Value]) Add(key Key, value Value, delay time.Duration)

func (*Queue[Key, Value]) Init

func (q *Queue[Key, Value]) Init(now func() time.Duration, exec func(Key, Value))

func (*Queue[Key, Value]) Len

func (q *Queue[Key, Value]) Len() int

func (*Queue[Key, Value]) Move

func (q *Queue[Key, Value]) Move(key Key, delay time.Duration)

func (*Queue[Key, Value]) Remove

func (q *Queue[Key, Value]) Remove(key Key)

Jump to

Keyboard shortcuts

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