delayheap

package
v0.9.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: MPL-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelayHeap

type DelayHeap struct {
	// contains filtered or unexported fields
}

DelayHeap wraps a heap and gives operations other than Push/Pop. The inner heap is sorted by the time in the WaitUntil field of delayHeapNode

func NewDelayHeap

func NewDelayHeap() *DelayHeap

func (*DelayHeap) Contains

func (p *DelayHeap) Contains(heapNode HeapNode) bool

func (*DelayHeap) Length

func (p *DelayHeap) Length() int

func (*DelayHeap) Peek

func (p *DelayHeap) Peek() *delayHeapNode

func (*DelayHeap) Pop

func (p *DelayHeap) Pop() *delayHeapNode

func (*DelayHeap) Push

func (p *DelayHeap) Push(dataNode HeapNode, next time.Time) error

func (*DelayHeap) Remove

func (p *DelayHeap) Remove(heapNode HeapNode) error

func (*DelayHeap) Update

func (p *DelayHeap) Update(heapNode HeapNode, waitUntil time.Time) error

type HeapNode

type HeapNode interface {
	Data() interface{} // The data object
	ID() string        // ID of the object, used in conjunction with namespace for deduplication
	Namespace() string // Namespace of the object, can be empty
}

HeapNode is an interface type implemented by objects stored in the DelayHeap

Jump to

Keyboard shortcuts

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