fate 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fate/process_manager.rb +12 -1
- metadata +2 -2
data/lib/fate/process_manager.rb
CHANGED
@@ -97,7 +97,7 @@ class Fate
|
|
97
97
|
end
|
98
98
|
@threads[name] = Thread.current
|
99
99
|
|
100
|
-
|
100
|
+
copy_stream(pipe, handler)
|
101
101
|
pid, status = Process.wait2(pid)
|
102
102
|
handle_child_termination(pid, status)
|
103
103
|
end
|
@@ -105,6 +105,17 @@ class Fate
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
+
# Replacement for IO.copy_stream, which is a native function. We've been
|
109
|
+
# seeing segfaults when using it for lots of data.
|
110
|
+
def copy_stream(src, dest)
|
111
|
+
begin
|
112
|
+
while s = src.readpartial(1024)
|
113
|
+
dest.write(s)
|
114
|
+
end
|
115
|
+
rescue EOFError
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
108
119
|
# list currently running commands
|
109
120
|
def running
|
110
121
|
names = @pids_by_name.map {|name, command| name }.sort
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|