evt-component_host 0.2.0.8 → 0.2.0.9
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/lib/component_host/host.rb +12 -12
- 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: a4054acc85fb1a1eface7243b635d88a4d43a3fbc22b63670ad9026b72ba8679
|
|
4
|
+
data.tar.gz: 94fe507a36d866f154787f7138e06b6e3833af93a93eab8b7c845f174cad14ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62964a6da5c708ad5433d463951ad1d918a2ccb262d4f0ab846a8987d10f00c4bc4ebe0e4cb43ae7b3fbb7a21baab08a050d89dcda1be83f60cf74ba7c63f3df
|
|
7
|
+
data.tar.gz: 9122a0af92e618556dafdd6e4ff3edcdb1d6233c75cdabeaedc563e7e4d4f8fd4c2f93c56076f34f8ee4a01b7ae46a2760e7e0389d138982939996127679d4fc
|
data/lib/component_host/host.rb
CHANGED
|
@@ -12,16 +12,16 @@ module ComponentHost
|
|
|
12
12
|
instance
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def register(
|
|
16
|
-
|
|
15
|
+
def register(component_initiator, name=nil, &block)
|
|
16
|
+
component_initiator ||= proc { yield }
|
|
17
17
|
|
|
18
|
-
logger.trace { "Registering component (
|
|
18
|
+
logger.trace { "Registering component (Component Initiator: #{component_initiator}, Name: #{name || '(none)'})" }
|
|
19
19
|
|
|
20
|
-
component = Component.new
|
|
20
|
+
component = Component.new component_initiator, name
|
|
21
21
|
|
|
22
22
|
components << component
|
|
23
23
|
|
|
24
|
-
logger.info(tag: :*) { "Registered component (
|
|
24
|
+
logger.info(tag: :*) { "Registered component (Component Initiator: #{component_initiator}, Name: #{name || '(none)'})" }
|
|
25
25
|
|
|
26
26
|
component
|
|
27
27
|
end
|
|
@@ -43,7 +43,7 @@ module ComponentHost
|
|
|
43
43
|
|
|
44
44
|
send.(message, supervisor.address)
|
|
45
45
|
|
|
46
|
-
logger.info(tags: [:*, :signal]) { "Handled TSTP signal (
|
|
46
|
+
logger.info(tags: [:*, :signal]) { "Handled TSTP signal (Message Name: #{message.message_name}, SupervisorAddress: #{supervisor.address.id})" }
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
signal.trap 'CONT' do
|
|
@@ -51,7 +51,7 @@ module ComponentHost
|
|
|
51
51
|
|
|
52
52
|
send.(message, supervisor.address)
|
|
53
53
|
|
|
54
|
-
logger.info(tags: [:*, :signal]) { "Handled CONT signal (
|
|
54
|
+
logger.info(tags: [:*, :signal]) { "Handled CONT signal (Message Name: #{message.message_name}, SupervisorAddress: #{supervisor.address.id})" }
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
signal.trap 'INT' do
|
|
@@ -59,7 +59,7 @@ module ComponentHost
|
|
|
59
59
|
|
|
60
60
|
send.(message, supervisor.address)
|
|
61
61
|
|
|
62
|
-
logger.info(tags: [:*, :signal]) { "Handled INT signal (
|
|
62
|
+
logger.info(tags: [:*, :signal]) { "Handled INT signal (Message Name: #{message.message_name}, SupervisorAddress: #{supervisor.address.id})" }
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
signal.trap 'TERM' do
|
|
@@ -67,7 +67,7 @@ module ComponentHost
|
|
|
67
67
|
|
|
68
68
|
send.(message, supervisor.address)
|
|
69
69
|
|
|
70
|
-
logger.info(tags: [:*, :signal]) { "Handled TERM signal (
|
|
70
|
+
logger.info(tags: [:*, :signal]) { "Handled TERM signal (Message Name: #{message.message_name}, SupervisorAddress: #{supervisor.address.id})" }
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
start_components do |component|
|
|
@@ -105,9 +105,9 @@ module ComponentHost
|
|
|
105
105
|
@components ||= []
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
-
Component = Struct.new :
|
|
108
|
+
Component = Struct.new :component_initiator, :name do
|
|
109
109
|
def start
|
|
110
|
-
|
|
110
|
+
component_initiator.()
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
@@ -116,7 +116,7 @@ module ComponentHost
|
|
|
116
116
|
block ||= proc { true }
|
|
117
117
|
|
|
118
118
|
components.any? do |component|
|
|
119
|
-
block.(component.
|
|
119
|
+
block.(component.component_initiator, component.name)
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: evt-component_host
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.0.
|
|
4
|
+
version: 0.2.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Eventide Project
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ntl-actor
|