Redisq is a queue-over-redis that provides simple way to works with queues stored in Redis.

Redisq

Redisq is a queue-over-redis that provides simple way to works with queues stored in Redis.

Lib works over redis lib.

Advantages

  • Simple - just launch redis-server on persistent mode
  • Enough persistence
  • Good for periodic poll model
  • No need for mature message broker on simple queue task, use if you already have redis-server
  • Distributed write

Disadvantages

  • No broadcasting
  • No distributed read
  • One transaction per time

Warnings

  • Use noeviction mode of redis-server for persist your data

Requirements

  • Redis-server >= 6.2.0

Installation

go get github.com/go-redis/redis@latest

Features:

  • BeginRead locks queue for reading
  • Push into queue without blocking
  • Scan from queue without removing
  • Commit scanned elements
  • Rollback transaction with moving elements into end of queue
  • Cancel breaks transaction, remains elements in queue

On BeginRead queue locks for read and unlocks after Commit, Rollback, or Cancel.

For generic usage with any type lib provides StringConverter interface

Example

type intStringer int // implements redisq.StringConverter

setter := intStringer(1)

q, _ := redisq.NewSeqQueue(cfg)

q.Push(ctx, setter)

getter := intStringer(0)

q.BeginRead(ctx)
q.Scan(ctx, getter)
q.Commit(ctx)

// getter will be intStringer(1)

See queue_test.go for more examples.

Roadmap

  • Distributed read
  • Queue with priority
  • Non-blocking transactions

Run tests

Warning: tests clear the storage after every test.

  • Set TEST_REDIS_QUEUE_NETWORK and TEST_REDIS_QUEUE_ADDR, or just launch redis-server on localhost:6379
  • Run go test ./...
Similar Resources

cpuworker - A Customized Goroutine Scheduler over Golang Runtime

cpuworker - A Customized Goroutine Scheduler over Golang Runtime

cpuworker Status Working in process. Run the Demo Make sure the GOMAXPROCS is bigger than 1 and there is at least GOMAXPROCS physical OS threads avail

Dec 6, 2022

A way of scheduling volcano jobs

JobFlow 背景 volcano Volcano是CNCF 下首个也是唯一的基于Kubernetes的容器批量计算平台,主要用于高性能计算场景。 它提供了Kubernetes目前缺 少的一套机制,这些机制通常是机器学习大数据应用、科学计算、 特效渲染等多种高性能工作负载所需的。 现状:当前vol

Oct 12, 2022

Simple, efficient background processing for Golang backed by RabbitMQ and Redis

Simple, efficient background processing for Golang backed by RabbitMQ and Redis

Table of Contents How to Use Motivation Requirements Features Examples Setup Config Client/Server Task Worker/Task Hander Register The Handlers Send t

Nov 10, 2022

Job worker service that provides an API to run arbitrary Linux processes.

Job worker service that provides an API to run arbitrary Linux processes.

Job Scheduler Summary Prototype job worker service that provides an API to run arbitrary Linux processes. Overview Library The library (Worker) is a r

May 26, 2022

Marshmallow provides a flexible and performant JSON unmarshalling in Go. It specializes in dealing with unstructured struct - when some fields are known and some aren't, with zero performance overhead nor extra coding needed.

Marshmallow provides a flexible and performant JSON unmarshalling in Go. It specializes in dealing with unstructured struct - when some fields are known and some aren't, with zero performance overhead nor extra coding needed.

Marshmallow Marshmallow package provides a simple API to perform flexible and performant JSON unmarshalling in Go. Marshmallow specializes in dealing

Dec 26, 2022

goInterLock is golang job/task scheduler with distributed locking mechanism (by Using Redis🔒).

goInterLock is golang job/task scheduler with distributed locking mechanism (by Using Redis🔒).

goInterLock is golang job/task scheduler with distributed locking mechanism. In distributed system locking is preventing task been executed in every instant that has the scheduler,

Dec 5, 2022

基于 Redis 和 Cron 的定时任务队列

RTask RTask 是 Golang 一款基于 Redis 和 Cron 的定时任务队列。 快速上手 您需要使用 Go Module 导入 RTask 工具包。 go get -u github.com/avtion/rtask 使用教程 package main import ( "con

Oct 27, 2021

clockwork - Simple and intuitive job scheduling library in Go.

clockwork - Simple and intuitive job scheduling library in Go.

clockwork A simple and intuitive scheduling library in Go. Inspired by python's schedule and ruby's clockwork libraries. Example use package main imp

Jul 27, 2022

A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

Cron.go This is a simple library to handle scheduled tasks. Tasks can be run in a minimum delay of once a second--for which Cron isn't actually design

Dec 17, 2022
Related tags
Machinery is an asynchronous task queue/job queue based on distributed message passing.
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

Dec 24, 2022
This package provides the way to get the previous timestamp or the next timestamp that satisfies the cron expression.

Cron expression parser Given a cron expression, you can get the previous timestamp or the next timestamp that satisfies the cron expression. I have us

May 3, 2022
personal tweet scheduler - it needs my guidance now for it to work for you - it works on my mac - will release it someday

tit tit daemon write tests automate build & install plist replace {{path_for_titd_executable}} accordingly. <?xml version="1.0" encoding="UTF-8"?> <!D

Feb 4, 2022
Gotask - A simple task queue is stripped when the program is written to achieve the task delivery function
Gotask - A simple task queue is stripped when the program is written to achieve the task delivery function

gotask The simple task queue is stripped when the program is written to achieve

Feb 14, 2022
Executes jobs in separate GO routines. Provides Timeout, StartTime controls. Provides Cancel all running job before new job is run.

jobExecutor Library to execute jobs in GO routines. Provides for Job Timeout/Deadline (MaxDuration()) Job Start WallClock control (When()) Add a job b

Jan 10, 2022
Celery Distributed Task Queue in Go
Celery Distributed Task Queue in Go

gocelery Go Client/Server for Celery Distributed Task Queue Why? Having been involved in several projects migrating servers from Python to Go, I have

Jan 1, 2023
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

Dec 9, 2022
YTask is an asynchronous task queue for handling distributed jobs in golang
YTask is an asynchronous task queue for handling distributed jobs in golang

YTask is an asynchronous task queue for handling distributed jobs in golang

Dec 24, 2022
Fulfills a GitHub workflow_job webhooks into a Pub/Sub queue.

GitHub Workflow Job to Pub/Sub The GitHub Workflow Job to Pub/Sub is a small service that fulfills a GitHub workflow_job webhook. When a job is queued

Mar 3, 2022
a self terminating concurrent job queue for indeterminate workloads in golang

jobtracker - a self terminating concurrent job queue for indeterminate workloads in golang This library is primarily useful for technically-recursive

Sep 6, 2022