isomorfeus-speednode 0.2.5 → 0.2.6
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/isomorfeus/speednode/runtime.rb +10 -4
- data/lib/isomorfeus/speednode/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: f167c560233ea7e7be7878c82904042713a770bed43a0aea82be00873c2cdd5a
|
4
|
+
data.tar.gz: 520b52ea901320c811a772b82ca169b243c1bebe74bce0fcc6ea619cf0207eee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7030fae1af851c181b641fb1dcccc5d09f4fe19dd41ec44210b42d0e74b06f4ea20f1ebfb9f48716a7fc93a47fae24711584074027e825739cf789f975bb5a96
|
7
|
+
data.tar.gz: 41b7b7886d40935f03bc481b57d4856842178b8d260964008df82c99776e623909390016e498d3e5f62ecbdc64cf9de8cda09eb1f9730882a20a09e5ccfa7c28
|
@@ -32,10 +32,13 @@ module Isomorfeus
|
|
32
32
|
@started
|
33
33
|
end
|
34
34
|
|
35
|
-
def self.finalize(socket)
|
35
|
+
def self.finalize(socket, socket_dir, socket_path, pid)
|
36
36
|
proc {
|
37
37
|
VMCommand.new(socket, "exit", [0]).execute
|
38
38
|
socket.close
|
39
|
+
File.unlink(socket_path)
|
40
|
+
Dir.rmdir(socket_dir)
|
41
|
+
Process.kill('KILL', pid)
|
39
42
|
}
|
40
43
|
end
|
41
44
|
|
@@ -61,8 +64,8 @@ module Isomorfeus
|
|
61
64
|
|
62
65
|
def start_without_synchronization
|
63
66
|
return if @started
|
64
|
-
|
65
|
-
@socket_path = File.join(
|
67
|
+
@socket_dir = Dir.mktmpdir("isomorfeus-speednode-")
|
68
|
+
@socket_path = File.join(@socket_dir, "socket")
|
66
69
|
@pid = Process.spawn({"SOCKET_PATH" => @socket_path}, @options[:binary], @options[:runner_path])
|
67
70
|
|
68
71
|
retries = 20
|
@@ -82,10 +85,13 @@ module Isomorfeus
|
|
82
85
|
unless @socket.closed?
|
83
86
|
VMCommand.new(@socket, "exit", [0]).execute
|
84
87
|
@socket.close
|
88
|
+
File.unlink(@socket_path)
|
89
|
+
Dir.rmdir(@socket_dir)
|
90
|
+
Process.kill('KILL', @pid)
|
85
91
|
end
|
86
92
|
end
|
87
93
|
|
88
|
-
ObjectSpace.define_finalizer(self, self.class.finalize(@socket))
|
94
|
+
ObjectSpace.define_finalizer(self, self.class.finalize(@socket, @socket_dir, @socket_path, @pid))
|
89
95
|
end
|
90
96
|
|
91
97
|
def command(cmd, *arguments)
|