flor 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/lib/flor.rb +1 -1
- data/lib/flor/flor.rb +4 -5
- data/lib/flor/id.rb +4 -1
- data/lib/flor/punit/m_ram.rb +4 -4
- data/lib/flor/unit/scheduler.rb +3 -0
- data/lib/flor/unit/storage.rb +3 -2
- data/lib/flor/unit/waiter.rb +18 -14
- data/lib/flor/unit/wlist.rb +9 -0
- 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: 1e6d591b2767c85e10b697b1839fb9142b52d0409bca73da41baa571f4e3aa8b
|
4
|
+
data.tar.gz: 6e9b4d916ccf37ee6189aed18a9365b98e79f8b6329cce4f1b4ed89f0acd4230
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1572f392ea4e391674b79b02d09992a3c27c64485c64132ac84c3d37a031436fec5090cf2e2932996c8ee7e2879ce5f502a7c037324d48cba505b15d3924a0bf
|
7
|
+
data.tar.gz: a8f1272f9b4a992fac31530d9e53b6e8c91fbd8032891087dd546c677fb1c9f8218a051eac9fe54c23c8bb8cdb6b3b727f269768f92fb62d8fb6cb1bdf1318f0
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,14 @@
|
|
2
2
|
# CHANGELOG.md
|
3
3
|
|
4
4
|
|
5
|
-
## flor 0.
|
5
|
+
## flor 1.0.1 released 2020-11-23
|
6
|
+
|
7
|
+
* Accept sto_uri strings pointing to constant like 'DB'
|
8
|
+
|
9
|
+
|
10
|
+
## flor 1.0.0 released 2020-11-22
|
11
|
+
|
12
|
+
* Lots of incremental improvements
|
6
13
|
|
7
14
|
|
8
15
|
## flor 0.18.0 released 2019-05-05
|
data/lib/flor.rb
CHANGED
data/lib/flor/flor.rb
CHANGED
@@ -3,12 +3,11 @@
|
|
3
3
|
module Flor
|
4
4
|
|
5
5
|
NAME_REX = '[a-zA-Z0-9_]+'
|
6
|
-
UNIT_NAME_REX = /\A#{NAME_REX}\z
|
7
|
-
DOMAIN_NAME_REX = /\A#{NAME_REX}(\.#{NAME_REX})*\z
|
8
|
-
FLOW_NAME_REX = /\A(#{NAME_REX}(?:\.#{NAME_REX})*)\.([a-zA-Z0-9_-]+)\z
|
6
|
+
UNIT_NAME_REX = /\A#{NAME_REX}\z/.freeze
|
7
|
+
DOMAIN_NAME_REX = /\A#{NAME_REX}(\.#{NAME_REX})*\z/.freeze
|
8
|
+
FLOW_NAME_REX = /\A(#{NAME_REX}(?:\.#{NAME_REX})*)\.([a-zA-Z0-9_-]+)\z/.freeze
|
9
9
|
|
10
|
-
|
11
|
-
DOMAIN_UNIT_REX = /\A(#{NAME_REX}(?:\.#{NAME_REX})*)-(#{NAME_REX})[-$]/
|
10
|
+
DOMAIN_UNIT_REX = /\A(#{NAME_REX}(?:\.#{NAME_REX})*)-(#{NAME_REX})[-$]/.freeze
|
12
11
|
|
13
12
|
SPLAT_REGEX = /\A(.*)__(_|\d+)\z/.freeze
|
14
13
|
|
data/lib/flor/id.rb
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
module Flor
|
4
4
|
|
5
|
+
NID_REX = /\A[0-9]+(?:_[0-9]+)*(?:-[0-9]+)?\z/.freeze
|
6
|
+
START_NID_REX = /\A[0-9]+(?:_[0-9]+)*(?:-[0-9]+)?/.freeze
|
7
|
+
|
5
8
|
class << self
|
6
9
|
|
7
10
|
#
|
@@ -99,7 +102,7 @@ module Flor
|
|
99
102
|
|
100
103
|
def is_nid?(s)
|
101
104
|
|
102
|
-
!! (s.is_a?(String) && s.match(
|
105
|
+
!! (s.is_a?(String) && s.match(NID_REX))
|
103
106
|
end
|
104
107
|
|
105
108
|
def split_exid(s)
|
data/lib/flor/punit/m_ram.rb
CHANGED
@@ -179,15 +179,15 @@ module Flor::Pro::ReceiveAndMerge
|
|
179
179
|
# * ignore
|
180
180
|
# * stack
|
181
181
|
|
182
|
-
STACK_REX = /\Astack(?::([-_a-zA-Z0-9]+))?\z
|
182
|
+
STACK_REX = /\Astack(?::([-_a-zA-Z0-9]+))?\z/.freeze
|
183
183
|
|
184
|
-
TRANSLATORS = { STACK_REX => 'k', /\Atail\z/ => 'a' }
|
184
|
+
TRANSLATORS = { STACK_REX => 'k', /\Atail\z/ => 'a' }.freeze
|
185
185
|
|
186
186
|
MORDERS = {
|
187
|
-
'f' => :first, 'l' => :last, /[tnh]/ => :north, /[bsa]/ => :south }
|
187
|
+
'f' => :first, 'l' => :last, /[tnh]/ => :north, /[bsa]/ => :south }.freeze
|
188
188
|
MMERGERS = {
|
189
189
|
'd' => :deep, /[mp]/ => :mix, 'o' => :override, 'i' => :ignore,
|
190
|
-
'k' => :stack }
|
190
|
+
'k' => :stack }.freeze
|
191
191
|
|
192
192
|
def default_merger
|
193
193
|
|
data/lib/flor/unit/scheduler.rb
CHANGED
data/lib/flor/unit/storage.rb
CHANGED
@@ -822,8 +822,9 @@ module Flor
|
|
822
822
|
fail ArgumentError.new("no 'sto_uri' conf, cannot connect to db") \
|
823
823
|
unless uri
|
824
824
|
|
825
|
-
|
826
|
-
|
825
|
+
return Kernel.const_get(uri) \
|
826
|
+
if uri.is_a?(String) && uri.match(/\A[A-Z]+\z/)
|
827
|
+
# for cases where uri == 'DB'
|
827
828
|
|
828
829
|
Sequel.connect(uri)
|
829
830
|
end
|
data/lib/flor/unit/waiter.rb
CHANGED
@@ -23,7 +23,7 @@ module Flor
|
|
23
23
|
@executor = nil
|
24
24
|
end
|
25
25
|
|
26
|
-
ROW_PSEUDO_POINTS = %w[ status tag tasker var variable ]
|
26
|
+
ROW_PSEUDO_POINTS = %w[ status tag tasker var variable ].freeze
|
27
27
|
# "tasker", not "task", since "task" is already a message point
|
28
28
|
|
29
29
|
def row_waiter?
|
@@ -247,15 +247,7 @@ module Flor
|
|
247
247
|
end
|
248
248
|
end
|
249
249
|
|
250
|
-
|
251
|
-
%r{
|
252
|
-
\A
|
253
|
-
([0-9_\-]+)?[ ]*
|
254
|
-
(
|
255
|
-
[a-z]+(?::[^:|;,\s]+){0,2}
|
256
|
-
(?:[|, ][a-z]+(:[^:|;,\s]+){0,2})*
|
257
|
-
)\z
|
258
|
-
}x
|
250
|
+
PT_REX = /[a-z]+(?::[^:|,\s]+){0,2}/.freeze
|
259
251
|
|
260
252
|
def parse_serie(s)
|
261
253
|
|
@@ -263,11 +255,23 @@ module Flor
|
|
263
255
|
|
264
256
|
(s.is_a?(String) ? s.split(';') : s)
|
265
257
|
.collect { |ss|
|
266
|
-
|
258
|
+
|
259
|
+
k = StringScanner.new(ss.strip)
|
260
|
+
|
261
|
+
ni = k.scan(Flor::START_NID_REX)
|
262
|
+
|
263
|
+
k.scan(/\s*/)
|
264
|
+
|
265
|
+
pts = []; loop do
|
266
|
+
pt = k.scan(PT_REX); break unless pt
|
267
|
+
pts << pt
|
268
|
+
k.scan(/\s*[|,]\s*/)
|
269
|
+
end
|
270
|
+
|
267
271
|
fail ArgumentError.new(
|
268
|
-
"cannot parse #{ss.strip.inspect} wait directive") unless
|
269
|
-
|
270
|
-
[ ni,
|
272
|
+
"cannot parse #{ss.strip.inspect} wait directive") unless k.eos?
|
273
|
+
|
274
|
+
[ ni, pts ] }
|
271
275
|
end
|
272
276
|
end
|
273
277
|
end
|
data/lib/flor/unit/wlist.rb
CHANGED
@@ -12,6 +12,15 @@ module Flor
|
|
12
12
|
# `wtl_row_frequency`:
|
13
13
|
# sleep time between row waiter checks, defaults to 1
|
14
14
|
|
15
|
+
# Regular waiters are message waiters, they wait for a message
|
16
|
+
# that matches a pattern
|
17
|
+
#
|
18
|
+
# Row waiters are waiting for the pattern to realize in the database
|
19
|
+
# a better name would probably have been "query waiter".
|
20
|
+
# Row waiters need their own thread for checking at interval.
|
21
|
+
# Row waiters can live in a different Ruby process from the Ruby process
|
22
|
+
# performing the executions.
|
23
|
+
|
15
24
|
DEFAULT_TIMEOUT = Flor.env_i('FLOR_DEFAULT_TIMEOUT')
|
16
25
|
|
17
26
|
def initialize(unit)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mettraux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: munemo
|