bellbro 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bellbro/pool.rb +14 -10
- data/lib/bellbro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5430a1729634a4c4fd1c1c20af5e1287b95663c8
|
4
|
+
data.tar.gz: 8c7bb23d0b72b368fba061fa1490c1e08950a213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 490c58cf1d627a3e79831f44c7e092b938756d513f80fb33acb2d2f1a0287c56c8ab28a9baedc169eb3cc64a9d80d950b4a89234138de587f10a56c09fd3b15e
|
7
|
+
data.tar.gz: 1c8b268ecf3ced4f287b93af909aaafea24f7370a1e3e0845cdd8d1b1f39858988fd84f169883ddbb4eb033567cd953fb83bdf32d069abaede1b4f4799659802
|
data/lib/bellbro/pool.rb
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
module Bellbro
|
2
2
|
module Pool
|
3
|
+
|
4
|
+
def with_connection(pool_name: nil, &block)
|
5
|
+
retryable(sleep: 0.5) do
|
6
|
+
connection_pool(pool_name: pool_name).with &block
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def connection_pool(pool_name: nil)
|
11
|
+
self.class.connection_pool(pool_name: pool_name)
|
12
|
+
end
|
13
|
+
|
3
14
|
def self.included(klass)
|
4
15
|
klass.extend(self)
|
5
16
|
|
@@ -7,18 +18,11 @@ module Bellbro
|
|
7
18
|
def pool(pool_name)
|
8
19
|
@pool_name = pool_name
|
9
20
|
end
|
10
|
-
end
|
11
|
-
end
|
12
21
|
|
13
|
-
|
14
|
-
|
15
|
-
|
22
|
+
def connection_pool(pool_name: nil)
|
23
|
+
Bellbro::Settings.connection_pools[pool_name || @pool_name]
|
24
|
+
end
|
16
25
|
end
|
17
26
|
end
|
18
|
-
|
19
|
-
def connection_pool(pool_name: nil)
|
20
|
-
Bellbro::Settings.connection_pools[pool_name || @pool_name]
|
21
|
-
end
|
22
27
|
end
|
23
|
-
|
24
28
|
end
|
data/lib/bellbro/version.rb
CHANGED