Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

passcod/poele

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Redis queue processor in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages