priority

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package priority provides priority queue for libcentrifugo package Memory Engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Value    string // The value of the item; arbitrary.
	Priority int64  // The priority of the item in the queue.
	// contains filtered or unexported fields
}

An Item is something we manage in a priority queue.

type Queue

type Queue []*Item

A Queue implements heap.Interface and holds Items.

func MakeQueue

func MakeQueue() Queue

MakeQueue allows to create priority queue.

func (Queue) Len

func (pq Queue) Len() int

func (Queue) Less

func (pq Queue) Less(i, j int) bool

func (*Queue) Pop

func (pq *Queue) Pop() interface{}

Pop value from queue.

func (*Queue) Push

func (pq *Queue) Push(x interface{})

Push value into queue.

func (Queue) Swap

func (pq Queue) Swap(i, j int)

Jump to

Keyboard shortcuts

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