grumlin 0.10.0 → 0.10.1
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/lib/grumlin/step.rb +12 -2
- data/lib/grumlin/version.rb +1 -1
- data/lib/grumlin.rb +19 -13
- 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: 2306eba516eebd5d53ac7e8e77acd5d7b2fcb7ad3579e9abc734210aec20ce29
|
|
4
|
+
data.tar.gz: ebd72733ea3f6ac4554044a00aac252f6a14997664a7b95ebdba01d082e4c8cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bda5181c00cabc8d69fdaa891a81943527dabfaa69ce70babbba6c1f11efc83b6f942d23d6aaf792d580f842ca7f64971986def6e1cfc1e6d4d3626da05efa1b
|
|
7
|
+
data.tar.gz: 212fbac76d50dfe281e574604ffbb82e8008937d777c279575a05468ee0f063faa6f0a8fa1417e8ea40e96f72b1b9f1f61c9e881e7c9b800d25964ce3ad7932a
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
grumlin (0.10.
|
|
4
|
+
grumlin (0.10.1)
|
|
5
5
|
async-pool (~> 0.3)
|
|
6
6
|
async-websocket (~> 0.19)
|
|
7
7
|
oj (~> 3.12)
|
|
@@ -64,7 +64,7 @@ GEM
|
|
|
64
64
|
nio4r (2.5.8)
|
|
65
65
|
nokogiri (1.11.7-x86_64-linux)
|
|
66
66
|
racc (~> 1.4)
|
|
67
|
-
oj (3.13.
|
|
67
|
+
oj (3.13.6)
|
|
68
68
|
overcommit (0.57.0)
|
|
69
69
|
childprocess (>= 0.6.3, < 5)
|
|
70
70
|
iniparse (~> 1.4)
|
data/lib/grumlin/step.rb
CHANGED
|
@@ -10,8 +10,18 @@ module Grumlin
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def next
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
to_enum.next
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def hasNext # rubocop:disable Naming/MethodName
|
|
17
|
+
to_enum.peek
|
|
18
|
+
true
|
|
19
|
+
rescue StopIteration
|
|
20
|
+
false
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def to_enum
|
|
24
|
+
@to_enum ||= toList.to_enum
|
|
15
25
|
end
|
|
16
26
|
|
|
17
27
|
def toList
|
data/lib/grumlin/version.rb
CHANGED
data/lib/grumlin.rb
CHANGED
|
@@ -104,16 +104,10 @@ module Grumlin
|
|
|
104
104
|
@client_concurrency = 5
|
|
105
105
|
@client_factory = ->(url, parent) { Grumlin::Client.new(url, parent: parent) }
|
|
106
106
|
end
|
|
107
|
-
|
|
108
|
-
def default_pool
|
|
109
|
-
@default_pool ||= Async::Pool::Controller.new(Grumlin::Client::PoolResource, limit: pool_size)
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def reset!
|
|
113
|
-
@default_pool = nil
|
|
114
|
-
end
|
|
115
107
|
end
|
|
116
108
|
|
|
109
|
+
@pool_mutex = Mutex.new
|
|
110
|
+
|
|
117
111
|
class << self
|
|
118
112
|
def configure
|
|
119
113
|
yield config
|
|
@@ -124,14 +118,26 @@ module Grumlin
|
|
|
124
118
|
end
|
|
125
119
|
|
|
126
120
|
def default_pool
|
|
127
|
-
|
|
121
|
+
if Thread.current.thread_variable_get(:grumlin_default_pool)
|
|
122
|
+
return Thread.current.thread_variable_get(:grumlin_default_pool)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@pool_mutex.synchronize do
|
|
126
|
+
Thread.current.thread_variable_set(:grumlin_default_pool,
|
|
127
|
+
Async::Pool::Controller.new(Grumlin::Client::PoolResource,
|
|
128
|
+
limit: config.pool_size))
|
|
129
|
+
end
|
|
128
130
|
end
|
|
129
131
|
|
|
130
132
|
def close
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
return if Thread.current.thread_variable_get(:grumlin_default_pool).nil?
|
|
134
|
+
|
|
135
|
+
@pool_mutex.synchronize do
|
|
136
|
+
pool = Thread.current.thread_variable_get(:grumlin_default_pool)
|
|
137
|
+
pool.wait while pool.busy?
|
|
138
|
+
pool.close
|
|
139
|
+
Thread.current.thread_variable_set(:grumlin_default_pool, nil)
|
|
140
|
+
end
|
|
135
141
|
end
|
|
136
142
|
end
|
|
137
143
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grumlin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gleb Sinyavskiy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-09-
|
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async-pool
|