pqueue

package
v0.0.0-...-b268664 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const StandardQueueCapacity = 2048

Variables

View Source
var ListenerShouldNotBeNil = errors.New("Out-channel should not be nil")

Functions

This section is empty.

Types

type Message

type Message map[string]interface{}

type Message []byte

type PriorityQueue

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

func NewPriorityQueue

func NewPriorityQueue(capacity uint64, listener chan Message) (*PriorityQueue, error)

func (PriorityQueue) Len

func (q PriorityQueue) Len() int

func (PriorityQueue) Less

func (q PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Out

func (pq *PriorityQueue) Out() chan Message

func (*PriorityQueue) Pop

func (q *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (q *PriorityQueue) Push(x interface{})

func (*PriorityQueue) Send

func (pq *PriorityQueue) Send(m Message, priority uint64) (removed []QueueItem)

func (PriorityQueue) Swap

func (q PriorityQueue) Swap(i, j int)

type QueueItem

type QueueItem struct {
	Msg       Message
	Timestamp uint64
	Priority  uint64
}

Jump to

Keyboard shortcuts

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