queue

package
v0.0.0-...-b112531 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: LGPL-3.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 struct {
	Tasks  *managedrefs.ManagedRef[[]*Task]
	Weight int
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(weight int) *Queue

func (*Queue) AddTask

func (q *Queue) AddTask(task *Task)

func (*Queue) GetTasks

func (q *Queue) GetTasks() []*Task

func (*Queue) GetWeight

func (q *Queue) GetWeight() int

func (*Queue) LastFinish

func (q *Queue) LastFinish() *managedrefs.ManagedRef[time.Time]

func (*Queue) Pop

func (q *Queue) Pop() *Task

func (*Queue) SetLastFinish

func (q *Queue) SetLastFinish(t time.Time)

type Task

type Task struct {
	ID        ulid.ULID
	Weight    uint64
	ExecTime  time.Duration
	Timestamp time.Time
}

Jump to

Keyboard shortcuts

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