A light-weight and central mutex source for distributed systems.
make
docker build -t mootex .
./mootex
docker run -d --rm -p 3000 --name mootex mootex
docker pull hedenface/mootex:0.0.0
docker run -d --rm -p 3000 --name mootex hedenface/mootex:0.0.0
With any of the execution methods, you should now be able to use your central mutex in a few different ways.
curl http://localhost:3000/lock?key=MUTEX-NAME
or
curl http://localhost:3000/lockParameter?key=MUTEX-NAME
curl -X POST -d 'MUTEX-NAME' http://localhost:3000/lockPlaintextBody
curl -X POST -d '{"key":"MUTEX-NAME"}' http://localhost:3000/lockJSONBody
curl http://localhost:3000/unlock?key=MUTEX-NAME
or
curl http://localhost:3000/unlockParameter?key=MUTEX-NAME
curl -X POST -d 'MUTEX-NAME' http://localhost:3000/unlockPlaintextBody
curl -X POST -d '{"key":"MUTEX-NAME"}' http://localhost:3000/unlockJSONBody
When the lock has been activated, the http body will match locked
.
When the lock has been deactivated, the http body will match unlocked
.
Until activation or deactivation occurs, it will wait - so ensure your timeouts are set accordingly for your workload.