priorityqueue

package
v0.0.0-...-b78b3a4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriorityQueue

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

PriorityQueue是基本结构

func New

func New(n int, l int) *PriorityQueue

New是PriorityQueue的构造函数

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(ctx context.Context, x interface{}, p int) error

push将项目推送到priority参数中指定的适当队列 如果给定了上下文,它将一直等到推送该项或上下文中止为止。 否则,如果队列已满,则返回errCompetition

func (*PriorityQueue) Run

func (pq *PriorityQueue) Run(ctx context.Context, f func(interface{}))

运行是从队列中弹出项目的永久循环

Jump to

Keyboard shortcuts

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