rsmp 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yaml +14 -0
- data/Gemfile.lock +2 -1
- data/README.md +2 -2
- data/bin/console +1 -1
- data/documentation/classes_and_modules.md +4 -4
- data/documentation/collecting_message.md +2 -2
- data/documentation/tasks.md +149 -0
- data/lib/rsmp/archive.rb +3 -3
- data/lib/rsmp/cli.rb +27 -4
- data/lib/rsmp/collect/state_collector.rb +1 -1
- data/lib/rsmp/components.rb +3 -3
- data/lib/rsmp/convert/export/json_schema.rb +4 -4
- data/lib/rsmp/convert/import/yaml.rb +1 -1
- data/lib/rsmp/error.rb +0 -3
- data/lib/rsmp/inspect.rb +1 -1
- data/lib/rsmp/logger.rb +5 -5
- data/lib/rsmp/logging.rb +1 -1
- data/lib/rsmp/message.rb +1 -1
- data/lib/rsmp/node.rb +10 -45
- data/lib/rsmp/proxy.rb +176 -119
- data/lib/rsmp/rsmp.rb +1 -1
- data/lib/rsmp/site.rb +23 -60
- data/lib/rsmp/site_proxy.rb +21 -17
- data/lib/rsmp/supervisor.rb +25 -21
- data/lib/rsmp/supervisor_proxy.rb +53 -27
- data/lib/rsmp/task.rb +84 -0
- data/lib/rsmp/tlc/signal_group.rb +5 -3
- data/lib/rsmp/tlc/signal_plan.rb +2 -2
- data/lib/rsmp/tlc/traffic_controller.rb +42 -20
- data/lib/rsmp/tlc/traffic_controller_site.rb +43 -36
- data/lib/rsmp/version.rb +1 -1
- data/lib/rsmp.rb +1 -1
- metadata +5 -5
- data/lib/rsmp/site_proxy_wait.rb +0 -0
- data/lib/rsmp/wait.rb +0 -16
- data/test.rb +0 -27
data/lib/rsmp/site_proxy_wait.rb
DELETED
File without changes
|
data/lib/rsmp/wait.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
module RSMP
|
2
|
-
module Wait
|
3
|
-
# wait for an async condition to signal, then yield to block
|
4
|
-
# if block returns true we're done. otherwise, wait again
|
5
|
-
def wait_for condition, timeout, &block
|
6
|
-
raise RuntimeError.new("Can't wait for condition because task is not running") unless @task.running?
|
7
|
-
@task.with_timeout(timeout) do
|
8
|
-
while @task.running? do
|
9
|
-
value = condition.wait
|
10
|
-
result = yield value
|
11
|
-
return result if result # return result of check, if not nil
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/test.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
class A
|
2
|
-
def go &block
|
3
|
-
@block = block # block will be converted automatically to a Proc
|
4
|
-
indirect
|
5
|
-
end
|
6
|
-
|
7
|
-
def call
|
8
|
-
@block.call
|
9
|
-
end
|
10
|
-
|
11
|
-
def indirect
|
12
|
-
call
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
a = A.new
|
18
|
-
|
19
|
-
a.go do
|
20
|
-
break # this is ok. break causes the block to exit, and the encasing method to return - go() will exit
|
21
|
-
end
|
22
|
-
|
23
|
-
# this raises an error. the block we passed to go() will be called again, and it tries to break
|
24
|
-
# but we're not inside a method we can exit from
|
25
|
-
|
26
|
-
|
27
|
-
a.indirect
|