main_loop 0.1.2.16854 → 0.1.3.16874
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/main_loop/dispatcher.rb +1 -0
- data/lib/main_loop/handler.rb +4 -0
- data/lib/main_loop/loop.rb +2 -2
- data/lib/main_loop/process_handler.rb +1 -0
- data/lib/main_loop/thread_handler.rb +3 -1
- data/lib/main_loop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ddfd174c8f04a96a34dbddcfe2a4ee59e5747e52ffcd0403d3444c1d0d24356
|
4
|
+
data.tar.gz: 5a0ead0ebbc98c8f494eeb5166086e8aeed51c7b276d2deb6bffb2f16d300ebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18d1ef3fb48243f552efd0b703687f4b071cf05b2216f33b194aa80f5d343b80ee1035d25193fadbb0cc8582f70508793022a095166f952756f9b493d108b315
|
7
|
+
data.tar.gz: ad9e2b8cf3d045550bbfd9b08f8e0997194211a17a7d450d7c00256c604944172c9a6f98efdfedb0323cc81a51109ddf5e27bd3b12d214734b95c7d6351f1b93
|
data/lib/main_loop/dispatcher.rb
CHANGED
data/lib/main_loop/handler.rb
CHANGED
data/lib/main_loop/loop.rb
CHANGED
@@ -29,7 +29,7 @@ module MainLoop
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def start_loop_forever(timeout = 0)
|
32
|
-
wait = [timeout,
|
32
|
+
wait = [[(timeout / 2.5), 5].min, 5].max
|
33
33
|
Timeouter.loop(timeout) do
|
34
34
|
event = @bus.gets(wait)
|
35
35
|
logger.debug("command:#{event}")
|
@@ -49,7 +49,7 @@ module MainLoop
|
|
49
49
|
logger.debug("unknown event:#{event}")
|
50
50
|
end
|
51
51
|
|
52
|
-
@dispatcher.reap(reap_children)
|
52
|
+
@dispatcher.reap(reap_children) rescue nil
|
53
53
|
@dispatcher.tick
|
54
54
|
end
|
55
55
|
end
|
@@ -22,9 +22,9 @@ module MainLoop
|
|
22
22
|
logger.info "Thread[#{name}] exited: thread:#{@thread} Status:#{status}"
|
23
23
|
@thread = nil
|
24
24
|
@finished = true
|
25
|
-
@success = false
|
26
25
|
|
27
26
|
return if terminating?
|
27
|
+
@success = false
|
28
28
|
|
29
29
|
handle_retry
|
30
30
|
end
|
@@ -42,7 +42,9 @@ module MainLoop
|
|
42
42
|
@thread.kill rescue nil
|
43
43
|
else
|
44
44
|
@terminating_at ||= Time.now
|
45
|
+
@success = true
|
45
46
|
logger.info "Thread[#{name}] send terminate: thread:#{@thread}"
|
47
|
+
@on_term&.call(@thread) rescue nil
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
data/lib/main_loop/version.rb
CHANGED