The DLM maintains a list of system resources and provides locking mechanisms to control allocation and modification of resources.
npm install distributed-lock-managernpm install -g distributed-lock-manager
dlm-server --httpPort 5000 --tcpPort 5001 --maximumWaitForAcquireInMilliseconds 2000 --timeoutInMiliseconds 5000
TRUE when successfully acquired and FALSE when not acquired.
acquire
OK.
release
acquire command except that it will wait if it could not acquire the lock immediately.
waitAcquire