Skip to content
Redis queue processor in Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
poele.go

README.md

Poële

Poële is a very simple queue processor for Redis written in Go.

Usage

package main

import (
	"github.com/thesides/poele"
	"github.com/vmihailenco/redis"
)

func main() {
	client := redis.NewTCPClient(host, password, -1)
	defer client.Close()
	
	pan := poele.New(client, "channel", process)
	pan.Serve()
}

func process(message string) interface{} {
	return someLongComputation()
}

Now, just LPUSH some messages to the poele.channel.todo list in Redis and they will get processed by the process() function above. While they are being processed, they are stored in the poele.channel.processing list, and when each is completed it is moved to the poele.channel.done list.

It is recommended to just pass in a database ID and retrieve and update the records from the Go process() function to keep the Redis queues as clean and slim as possible.

You can’t perform that action at this time.