Skip to content

p40pmn/priority-queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Priority Queue System using Redis Sorted Sets

This project implements a priority queue using Redis' sorted sets to manage tasks or jobs. Redis' sorted sets provide an efficient way to manage ordered data with a unique score for each item, making them ideal for building a priority queue system.

Features

  • Priority-based queueing: Tasks are prioritized based on a score (e.g., timestamp, priority level).
  • Efficient: Leveraging Redis' sorted set to ensure fast insertion and retrieval.
  • Easy integration: Simple to integrate with your existing applications or services.

How it works

  • Each task in the queue is added to a Redis sorted set with a score that represents its priority.
  • The task with the lowest score is processed first (i.e., highest priority).
  • You can adjust priorities by updating the scores or adding/removing tasks.

Installation

To get started, make sure you have Redis installed and running on your machine. Then, clone this repository and install the dependencies.

git clone git@github.com:p40pmn/priority-queue.git
cd priority-queue

Run

  go mod tidy
  go run example/main.go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages