tasks

package
v0.0.0-...-85469d9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimplePriorityQueue

type SimplePriorityQueue []*SimpleTask

SimplePriorityQueue holds a list of tasks

func (SimplePriorityQueue) Len

func (spq SimplePriorityQueue) Len() int

Len is the length of a simple priority queue (interface function)

func (SimplePriorityQueue) Less

func (spq SimplePriorityQueue) Less(i, j int) bool

Less helps Pop to figure out what is the highest priority (interface function)

func (*SimplePriorityQueue) Pop

func (spq *SimplePriorityQueue) Pop() interface{}

Pop the last item at the queue (interface function)

func (*SimplePriorityQueue) Push

func (spq *SimplePriorityQueue) Push(x interface{})

Push pushes a new item to the end of the queue (interface function)

func (SimplePriorityQueue) Swap

func (spq SimplePriorityQueue) Swap(i, j int)

Swap changes the position of two jobs (interface function)

func (*SimplePriorityQueue) Update

func (spq *SimplePriorityQueue) Update(task *SimpleTask, dbID int64, value string, priority int)

Update the current task

type SimpleTask

type SimpleTask struct {
	DBID     int64
	Value    string
	Priority int
	// contains filtered or unexported fields
}

SimpleTask holds details about task to do

Jump to

Keyboard shortcuts

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