safeHeap

package
v0.0.0-...-ed45dd3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeHeap

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

SafeHeap creates a co-routine safe Heap comprised a data type that implements heap.Interface

func New

func New(h heap.Interface) (s *SafeHeap)

New creates a new heap that is safe for concurrent use from h

func (*SafeHeap) Destroy

func (s *SafeHeap) Destroy()

Destroy closes the primary channel stopping the running go routine.

func (*SafeHeap) Len

func (s *SafeHeap) Len() (l int)

Len provides the current length of the Heap

func (*SafeHeap) Pop

func (s *SafeHeap) Pop() interface{}

Pop removes the next value fom the heap

func (*SafeHeap) Push

func (s *SafeHeap) Push(x interface{}) bool

Push will insert the item into the heap

func (*SafeHeap) Remove

func (s *SafeHeap) Remove(idx int) interface{}

Remove will remove the item and idx from the heap

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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