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"
- Host: GitHub
- URL: https://github.com/faust64/redis-conductor
- Owner: faust64
- License: bsd-3-clause
- Created: 2018-01-09T12:11:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T10:36:16.000Z (over 2 years ago)
- Last Synced: 2025-04-19T06:38:47.369Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Redis-Conductor
* Last tests against master on CircleCI: [](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');
}
```