An open API service indexing awesome lists of open source software.

https://github.com/faust64/redis-conductor

Redis-backed processes orchestrator - as in "pick a master in a bunch of processes"
https://github.com/faust64/redis-conductor

Last synced: 21 days ago
JSON representation

Redis-backed processes orchestrator - as in "pick a master in a bunch of processes"

Awesome Lists containing this project

README

        

# Redis-Conductor

* Last tests against master on CircleCI: [![CircleCI](https://circleci.com/gh/faust64/redis-conductor.svg?style=svg)](https://circleci.com/gh/faust64/redis-conductor)

* Install with `npm install redis-conductor`

* Running several instances of the same process:

```
const conductor = require('redis-conductor');
//use redis server at 127.0.0.0:6379, db #0
const neighbors = conductor('my-process-name');

//or pass in redis optional options:
//const neighbors = conductor('my-process-name', { host: redisBackend, port: redisPort, dbId: redisDb, authPass: redisPass );

[...]
if (neighbors.isElectedMaster() !== false) {
console.log('we know that process is currently our master');
console.log('exec some task that should not run twice simultaneously');
} else {
console.log('There is no spoon');
}
```