Clever/go-redis-reservation

Name: go-redis-reservation

Owner: Clever

Description: Golang library for resource reservation using Redis

Created: 2015-04-29 03:01:40.0

Updated: 2018-05-15 01:30:50.0

Pushed: 2018-05-18 23:01:46.0

Homepage: null

Size: 35

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

go-redis-reservation

Golang library for resource reservation using Redis

Usage
port {
"github.com/Clever/go-redis-reservation/reservation"


nager, err := reservation.NewManager("my-redis-host.com:6379", "myWorkerName")
 err != nil {
// Error connecting to redis


servation, err := manager.Lock(jobName)
 err != nil {
// Reservation is already held for jobName


Worker.DoWork()

r = reservation.Release()
Testing

The tests depend on a local redis instance. Run

dis-server &
ke test

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.