文件名称:node-etcd-lock:由etcd v3支持的Node.js分布式锁
文件大小:27KB
文件格式:ZIP
更新时间:2024-05-22 00:10:13
distributed-locks etcdv3 JavaScript
节点等锁 由支持的Node.js分布式锁。 安装 npm install node-etcd-lock 用法 'use strict' const assert = require ( 'assert' ) const Locker = require ( 'node-etcd-lock' ) const locker = new Locker ( { address : '127.0.0.1:2379' } ) ; ( async function ( ) { // Acquire a lock for a specified recource. const lock = await locker . lock ( 'resource_key' , 3 * 1000 ) // This lock will be acquired after 3000 ms. const
【文件预览】:
node-etcd-lock-master
----proto()
--------rpc.proto(1KB)
--------v3lock.proto(726B)
----.gitignore(884B)
----package.json(901B)
----package-lock.json(97KB)
----.travis.yml(382B)
----LICENSE(1KB)
----index.js(3KB)
----README.md(2KB)
----lock.js(322B)
----test()
--------index.js(4KB)