acts_as_lockable_by 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +2 -2
- data/lib/acts_as_lockable_by/lockable.rb +1 -1
- data/lib/acts_as_lockable_by/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3976883f5be56291cff8cba6cb37aba57df6fefc8c1f5a0d74bbbd2b0b359f1b
|
4
|
+
data.tar.gz: fad1c05df1f2f440177d5e9ec00f4713f96c11e50cdeaa0b4cfb37a813af3112
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78a174973d5cbae20549a4402754488ac95f010f13b3cdf978ba100046aa7244c4e41ba48a9bbb7cc7628cb3375ab2c628ba06ecba09dabb0b9228db4b8738cb
|
7
|
+
data.tar.gz: 96858980e66076a9c880399d6dc977e006679ec09efe3a756c92d837c732192e5cda36274a580a952f52a79f8c75b5d1049106070d378c7aa3bb39403d3271bd
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
acts_as_lockable_by (0.1.
|
4
|
+
acts_as_lockable_by (0.1.2)
|
5
5
|
activesupport (~> 5.0)
|
6
6
|
redis (~> 4)
|
7
7
|
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
awesome_print (1.8.0)
|
18
18
|
byebug (10.0.2)
|
19
19
|
coderay (1.1.2)
|
20
|
-
concurrent-ruby (1.1.
|
20
|
+
concurrent-ruby (1.1.2)
|
21
21
|
diff-lcs (1.3)
|
22
22
|
eventmachine (1.2.7)
|
23
23
|
htmlentities (4.3.4)
|
data/README.md
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
[](http://badge.fury.io/rb/acts_as_lockable_by)
|
4
4
|
[](https://travis-ci.com/tareksamni/acts_as_lockable_by)
|
5
5
|
|
6
|
-
This gem was originally developed and maintained
|
6
|
+
This gem was originally developed, incubated and maintained at [ABTION](https://abtion.com/). Its main goal is providing the ability to lock a resource so that no other users/lockers can access it till the lock is released or the ttl expires. It uses `redis` a shared memory space to share locks across different deployments which enables easy horizontal scalability for your ruby/rails project on multiple servers.
|
7
7
|
|
8
8
|
An example usage for this gem is when you need a blog post (resource) to be only edtiable by 1 user concurrently. So the first user to lock the blog post to himself will always have access and be able to edit it. This user will need to renew the lock before the `ttl` expires otherwise the post will be unlocked/released and any other users can lock it to themselves.
|
9
9
|
|
10
10
|
`ActsAsLockableBy` uses `redis` as a shared distributed efficient lock manager with its built-in ability to expire locks when `ttl` expires.
|
11
11
|
|
12
|
-
The `lock`, `unlock` and `renew_lock` methods in this gem are all atomic operations and running as one redis call on the redis server.
|
12
|
+
The `lock`, `unlock` and `renew_lock` methods in this gem are all atomic operations and running as one redis call on the redis server. Even multiple clients calling any of these methods against the same key/resource will never enter into a race condition or thread unsafety scenarios.
|
13
13
|
|
14
14
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
15
15
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_lockable_by
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tarek N. Elsamni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|