sequel-pg_advisory_lock 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -5
- data/sequel-pg_advisory_lock.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a40fd8d2f62e959b8f9814e0faf413e4d1b48d1
|
4
|
+
data.tar.gz: 5a98cb2b24085834aa948c4e344f366f6c413a89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7123c0f44ca88d7f16057d17b66deb98d1fad6cfcb826449a7f659d30337e2c6151c4b1756cc596aa4e337ebdf1c80ef0babb956c864d25c993351d787995a6d
|
7
|
+
data.tar.gz: f2eb700856791db03c8c4e6f42d51144e01fe454cbf82cacabb822ff05d51cb64e65ca89f892a8beb06b1a7c6f0d6dc77999ece95dc6ad8f799ef134f0bf2a73
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# sequel-pg_advisory_lock [![Build Status](https://travis-ci.org/yuryroot/sequel-pg_advisory_lock.svg?branch=master)](https://travis-ci.org/yuryroot/sequel-pg_advisory_lock)
|
2
2
|
|
3
3
|
Gem `sequel-pg_advisory_lock` is an extension for ruby [Sequel](https://github.com/jeremyevans/sequel) library
|
4
|
-
that
|
5
|
-
|
4
|
+
that allows using [PostgreSQL advisory locks](https://www.postgresql.org/docs/9.6/static/explicit-locking.html#ADVISORY-LOCKS)
|
5
|
+
for application-level mutexes.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -47,13 +47,15 @@ It's also possible to specify different function in second parameter of `registe
|
|
47
47
|
DB.register_advisory_lock(:my_lock, :pg_try_advisory_lock)
|
48
48
|
````
|
49
49
|
|
50
|
-
All supported lock functions are described
|
50
|
+
All supported lock functions are described [here](#available-types-of-locks).
|
51
51
|
|
52
52
|
Finally, you can use registered lock:
|
53
53
|
|
54
54
|
```ruby
|
55
55
|
DB.with_advisory_lock(:my_lock) do
|
56
|
-
# do something
|
56
|
+
# do something
|
57
|
+
# this block works like application-level mutex,
|
58
|
+
# so code inside block is protected from concurrent execution
|
57
59
|
end
|
58
60
|
|
59
61
|
```
|
@@ -62,7 +64,9 @@ An optional *4-bytes integer* parameter can be passed to `with_advisory_lock` me
|
|
62
64
|
|
63
65
|
```ruby
|
64
66
|
DB.with_advisory_lock(:my_lock, 1) do
|
65
|
-
# do something
|
67
|
+
# do something
|
68
|
+
# this block works like application-level mutex,
|
69
|
+
# so code inside block is protected from concurrent execution
|
66
70
|
end
|
67
71
|
|
68
72
|
```
|
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'sequel-pg_advisory_lock'
|
7
|
-
spec.version = '0.1.
|
7
|
+
spec.version = '0.1.2'
|
8
8
|
spec.authors = ['Yury Shchyhlinski']
|
9
9
|
spec.email = ['Shchyhlinski.YL@gmail.com']
|
10
10
|
|
11
|
-
spec.summary =
|
11
|
+
spec.summary = 'Extension for ruby Sequel library that allows using PostgreSQL advisory locks for application-level mutexes.'
|
12
12
|
spec.homepage = "https://github.com/yuryroot/#{spec.name}"
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-pg_advisory_lock
|
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
|
- Yury Shchyhlinski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -125,6 +125,6 @@ rubyforge_project:
|
|
125
125
|
rubygems_version: 2.5.1
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
|
-
summary:
|
129
|
-
|
128
|
+
summary: Extension for ruby Sequel library that allows using PostgreSQL advisory locks
|
129
|
+
for application-level mutexes.
|
130
130
|
test_files: []
|