Priority Queue in Go ==================== This package provides a priority queue implementation and scaffold interfaces. Installation ------------ Use the `goinstall` tool: $ goinstall github.com/nu7hatch/gopqueue ... or install it manually: $ git clone git://github.com/nu7hatch/gopqueue.git $ cd gopqueue $ make install Usage ----- Here's trivial example of the fast queue usage: package main import pqueue "github.com/nu7hatch/gopqueue" type Task struct { Name string priority int } func (t *Task) Less(other interface{}) bool { return t.priority < other.(*Task).priority } func main() { q := pqueue.New(0) q.Enqueue(&Task{"one", 10}) q.Enqueue(&Task{"two", 2}) q.Enqueue(&Task{"three", 5}) q.Enqueue(&Task{"four", 7}) for i := 0; i < 4; i += 1 { task := q.Dequeue() println(task.(*Task).Name) } } // Produces: // // two // three // four // one For more information and examples check the package documentation. Copyright --------- Copyright (C) 2011 by Krzysztof Kowalik <[email protected]> See COPYING file for details.
Simple priority queue in Go
Owner
Kris Kovalik
Similar Resources
BTree provides a simple, ordered, in-memory data structure for Go programs.
BTree implementation for Go This package provides an in-memory B-Tree implementation for Go, useful as an ordered, mutable data structure. The API is
A simple Bloom Filter implementation in Go
This is a simple Bloom filter implementation written in Go. For the theory behind Bloom filters, read http://en.wikipedia.org/wiki/Bloom_filter This
A simple and efficient thread-safe sharded hashmap for Go
shardmap A simple and efficient thread-safe sharded hashmap for Go. This is an alternative to the standard Go map and sync.Map, and is optimized for w
Simple dense bitmap index in Go with binary operators
This package contains a bitmap index which is backed by uint64 slice, easily encodable to/from a []byte without copying memory around so it can be present in both disk and memory. As opposed to something as roaring bitmaps, this is a simple implementation designed to be used for small to medium dense collections.
simple golang event bus structure
super simple and small event bus structure for golang that allows emissions as go routines.
Simple code just to try out and Binary Tree on Golang.
Character counter | ▮▮▮▮▮▮▮▮ Simple code just to try out and Binary Tree on Golang. Count characters to train openning a file and reading it, as well
A threadsafe single-value cache for Go with a simple but flexible API
SVCache SVCache is a threadsafe, single-value cache with a simple but flexible API. When there is no fresh value in the cache, an attempt to retrieve
Structscanner is a simple library to make going from database queries to structs easier
structscanner is a simple library to make going from database queries to structs easier, while retaining the flexibility of joins and mapping using struct tags.
Some helper types for go1: priority queue, slice wrapper.
go-villa Package villa contains some helper types for Go: priority queue, slice wrapper, binary-search, merge-sort. GoDoc Link: http://godoc.org/githu
A lightweight job scheduler based on priority queue with timeout, retry, replica, context cancellation and easy semantics for job chaining. Build for golang web apps.
Table of Contents Introduction What is RIO? Concern An asynchronous job processor Easy management of these goroutines and chaining them Introduction W
Go implementation of the van Emde Boas tree data structure: Priority queue for positive whole numbers in O(log log u) time.
vEB Go implementation of the van Emde Boas tree data structure: Priority queue for positive whole numbers in O(log log u) time. Supports the following
Priority queue with message-group based partitioning and equal attention guarantee for each message group based on Redis
redis-ordered-queue-go Priority queue with message-group based partitioning and equal attention guarantee for each message group based on Redis What i
Unlimited job queue for go, using a pool of concurrent workers processing the job queue entries
kyoo: A Go library providing an unlimited job queue and concurrent worker pools About kyoo is the phonetic transcription of the word queue. It provide
Machinery is an asynchronous task queue/job queue based on distributed message passing.
Machinery Machinery is an asynchronous task queue/job queue based on distributed message passing. V2 Experiment First Steps Configuration Lock Broker
Machinery is an asynchronous task queue/job queue based on distributed message passing.
Machinery Machinery is an asynchronous task queue/job queue based on distributed message passing. V2 Experiment First Steps Configuration Lock Broker
painless task queue manager for shell commands with an intuitive cli interface (execute shell commands in distributed cloud-native queue manager).
EXEQ DOCS STILL IN PROGRESS. Execute shell commands in queues via cli or http interface. Features Simple intuitive tiny cli app. Modular queue backend
A Multi Consumer per Message Queue with persistence and Queue Stages.
CrimsonQ A Multi Consumer per Message Queue with persistence and Queue Stages. Under Active Development Crimson Queue allows you to have multiple cons
go.fifo provides a simple fifo thread-safe queue for the Go programming language
go.fifo Description go.fifo provides a simple FIFO thread-safe queue. *fifo.Queue supports pushing an item at the end with Add(), and popping an item
Simple in-memory job queue for Golang using worker-based dispatching
artifex Simple in-memory job queue for Golang using worker-based dispatching Documentation here: https://godoc.org/github.com/mborders/artifex Cron jo
Related tags
go.fifo provides a simple fifo thread-safe queue for the Go programming language
go.fifo Description go.fifo provides a simple FIFO thread-safe queue. *fifo.Queue supports pushing an item at the end with Add(), and popping an item
A highly optimized double-ended queue
Overview Deque is a highly optimized double-ended queue. Benchmark Benchmark_PushBack/Deque<harden> 100000000 10.3 ns/op 9 B/op
Fast ring-buffer deque (double-ended queue)
deque Fast ring-buffer deque (double-ended queue) implementation. For a pictorial description, see the Deque diagram Installation $ go get github.com/
Go concurrent-safe, goroutine-safe, thread-safe queue
goconcurrentqueue - Concurrent safe queues The package goconcurrentqueue offers a public interface Queue with methods for a queue. It comes with multi
High-performance minimalist queue implemented using a stripped-down lock-free ringbuffer, written in Go (golang.org)
This project is no longer maintained - feel free to fork the project! gringo A high-performance minimalist queue implemented using a stripped-down loc
A Go queue manager on top of Redis
Queue A Go library for managing queues on top of Redis. It is based on a hiring exercise but later I found it useful for myself in a custom task proce
Cross-platform beanstalkd queue server admin console.
Overview aurora is a web-based Beanstalkd queue server console written in Go and works on macOS, Linux, and Windows machines. The main idea behind usi
Fast golang queue using ring-buffer
Queue A fast Golang queue using a ring-buffer, based on the version suggested by Dariusz Górecki. Using this instead of other, simpler, queue implemen
A simple set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp.
golang-set The missing set collection for the Go language. Until Go has sets built-in...use this. Coming from Python one of the things I miss is the s
A simple Set data structure implementation in Go (Golang) using LinkedHashMap.
Set Set is a simple Set data structure implementation in Go (Golang) using LinkedHashMap. This library allow you to get a set of int64 or string witho