Skip to content

Commit 7a1c95b

Browse files
committed
more doc updates
1 parent 4a8a1c3 commit 7a1c95b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ A dead simple distributed locking library for Node.js and [etcd](http://github.c
66
[![CircleCI](https://circleci.com/gh/thebigredgeek/microlock/tree/master.svg?style=shield)](https://circleci.com/gh/thebigredgeek/microlock/tree/master)
77

88

9+
10+
11+
## What is Etcd?
12+
13+
[Etcd](https://github.com/coreos/etcd) is a distributed key-value store, built by the [CoreOS](https://coreos.com/) team, that provides strong guarantees around consistency and partition tolerance. Data is duplicated to all nodes in a given cluster and remains consistent between node failures. Cluster leaders are elected via the [Raft consensus algorithm](https://raft.github.io/). Etcd provides operations for atomic value swapping/removal based on criteria and TTL for values, making it a perfect media for distributed locks.
14+
915
## What is a distrbuted lock?
1016

1117
A distributed lock is a mechanism that provides serialized flow control on a context that is acted on by more than one process. These processes typically operate on different machines via Service Oriented Architecture. Each process uses an object called a distributed lock to "lock" access to the shared context, aliased by a key, so that only one process, each aliased by a node id, can act on it at a time, thereby ensuring consistency and preventing race conditions.
@@ -117,6 +123,8 @@ main();
117123

118124
## Methods
119125

126+
All methods (except destroy) return promises, making it easy to use features like async/await with ES2016/ES2017 via Babel.
127+
120128
### Microlock(etcd, key, node_id, [ttl = 1])
121129
Creates a microlock client for a lock key.
122130

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "microlock",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Simple distributed locking with Etcd for Node.js",
55
"main": "lib/microlock.js",
66
"repository": {

0 commit comments

Comments
 (0)