slave 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +164 -26
- data/README.tmpl +83 -0
- data/doc/classes/(@object = Object.new).html +117 -0
- data/doc/classes/(o = Object.new).html +117 -0
- data/doc/classes/@object.html +117 -0
- data/doc/classes/Slave.html +458 -225
- data/doc/classes/Slave/Heartbeat.html +200 -199
- data/doc/classes/o.html +117 -0
- data/doc/classes/object.html +117 -0
- data/doc/created.rid +1 -1
- data/doc/dot/f_0.jpg +0 -0
- data/doc/dot/f_1.dot +9 -0
- data/doc/dot/f_1.jpg +0 -0
- data/doc/files/README.html +200 -45
- data/doc/files/lib/slave_rb.html +4 -2
- data/doc/fr_class_index.html +1 -0
- data/doc/fr_method_index.html +23 -19
- data/gen_readme.rb +32 -0
- data/lib/{slave-0.2.0.rb → slave-1.0.0.rb} +185 -60
- data/lib/slave.rb +185 -60
- data/{sample → samples}/a.rb +7 -10
- data/samples/b.rb +22 -0
- data/samples/c.rb +21 -0
- data/samples/d.rb +9 -0
- data/samples/e.rb +11 -0
- data/slave-1.0.0.gem +0 -0
- data/test.old/slave.rb +21 -0
- metadata +19 -7
- data/sample/b.rb +0 -8
- data/sample/c.rb +0 -109
@@ -75,7 +75,8 @@
|
|
75
75
|
<div id="contextContent">
|
76
76
|
<div id="diagram">
|
77
77
|
<map name="map">
|
78
|
-
<area shape="RECT" coords="
|
78
|
+
<area shape="RECT" coords="123,98,195,50" href="../o.html" alt="o">
|
79
|
+
<area shape="RECT" coords="27,98,99,50" href="../Slave.html" alt="Slave">
|
79
80
|
</map>
|
80
81
|
<img src="../../dot/f_1.jpg" usemap="#map" border=0 alt="TopLevel">
|
81
82
|
</div>
|
@@ -97,15 +98,15 @@ their parent being alive.
|
|
97
98
|
<h2 class="section-bar">Methods</h2>
|
98
99
|
|
99
100
|
<div class="name-list">
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
101
|
+
<a href="#M000018">child_start</a>
|
102
|
+
<a href="#M000021">child_start</a>
|
103
|
+
<a href="#M000015">new</a>
|
104
|
+
<a href="#M000017">parent_start</a>
|
105
|
+
<a href="#M000020">parent_start</a>
|
106
|
+
<a href="#M000016">start</a>
|
107
|
+
<a href="#M000019">start</a>
|
108
|
+
<a href="#M000022">stop</a>
|
109
|
+
<a href="#M000023">trace</a>
|
109
110
|
</div>
|
110
111
|
</div>
|
111
112
|
|
@@ -125,36 +126,36 @@ their parent being alive.
|
|
125
126
|
<div id="methods">
|
126
127
|
<h2 class="section-bar">Public Class methods</h2>
|
127
128
|
|
128
|
-
<div id="method-
|
129
|
-
<a name="
|
129
|
+
<div id="method-M000015" class="method-detail">
|
130
|
+
<a name="M000015"></a>
|
130
131
|
|
131
132
|
<div class="method-heading">
|
132
|
-
<a href="#
|
133
|
+
<a href="#M000015" class="method-signature">
|
133
134
|
<span class="method-name">new</span><span class="method-args">pulse_rate = 4.2, debug = false</span>
|
134
135
|
</a>
|
135
136
|
</div>
|
136
137
|
|
137
138
|
<div class="method-description">
|
138
139
|
<p><a class="source-toggle" href="#"
|
139
|
-
onclick="toggleCode('
|
140
|
-
<div class="method-source-code" id="
|
140
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
141
|
+
<div class="method-source-code" id="M000015-source">
|
141
142
|
<pre>
|
142
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
143
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 394</span>
|
144
|
+
394: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">pulse_rate</span> = <span class="ruby-value">4.2</span>, <span class="ruby-identifier">debug</span> = <span class="ruby-keyword kw">false</span>
|
145
|
+
395: <span class="ruby-comment cmt">#--{{{</span>
|
146
|
+
396: <span class="ruby-ivar">@pulse_rate</span> = <span class="ruby-constant">Float</span> <span class="ruby-identifier">pulse_rate</span>
|
147
|
+
397: <span class="ruby-ivar">@debug</span> = <span class="ruby-identifier">debug</span>
|
148
|
+
398: <span class="ruby-ivar">@r</span>, <span class="ruby-ivar">@w</span> = <span class="ruby-constant">IO</span><span class="ruby-operator">::</span><span class="ruby-identifier">pipe</span>
|
149
|
+
399: <span class="ruby-ivar">@pid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span>
|
150
|
+
400: <span class="ruby-ivar">@ppid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">ppid</span>
|
151
|
+
401: <span class="ruby-ivar">@cid</span> = <span class="ruby-keyword kw">nil</span>
|
152
|
+
402: <span class="ruby-ivar">@thread</span> = <span class="ruby-keyword kw">nil</span>
|
153
|
+
403: <span class="ruby-ivar">@ppid</span> = <span class="ruby-keyword kw">nil</span>
|
154
|
+
404: <span class="ruby-ivar">@whoami</span> = <span class="ruby-keyword kw">nil</span>
|
155
|
+
405: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">nil</span>
|
156
|
+
406: <span class="ruby-ivar">@pipe</span> = <span class="ruby-keyword kw">nil</span>
|
157
|
+
407: <span class="ruby-comment cmt">#--}}}</span>
|
158
|
+
408: <span class="ruby-keyword kw">end</span>
|
158
159
|
</pre>
|
159
160
|
</div>
|
160
161
|
</div>
|
@@ -162,281 +163,281 @@ their parent being alive.
|
|
162
163
|
|
163
164
|
<h2 class="section-bar">Public Instance methods</h2>
|
164
165
|
|
165
|
-
<div id="method-
|
166
|
-
<a name="
|
166
|
+
<div id="method-M000018" class="method-detail">
|
167
|
+
<a name="M000018"></a>
|
167
168
|
|
168
169
|
<div class="method-heading">
|
169
|
-
<a href="#
|
170
|
+
<a href="#M000018" class="method-signature">
|
170
171
|
<span class="method-name">child_start</span><span class="method-args">()</span>
|
171
172
|
</a>
|
172
173
|
</div>
|
173
174
|
|
174
175
|
<div class="method-description">
|
175
176
|
<p><a class="source-toggle" href="#"
|
176
|
-
onclick="toggleCode('
|
177
|
-
<div class="method-source-code" id="
|
177
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
178
|
+
<div class="method-source-code" id="M000018-source">
|
178
179
|
<pre>
|
179
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
180
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 443</span>
|
181
|
+
443: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">child_start</span>
|
182
|
+
444: <span class="ruby-comment cmt">#--{{{</span>
|
183
|
+
445: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'child'</span>
|
184
|
+
446: <span class="ruby-ivar">@pid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span>
|
185
|
+
447: <span class="ruby-ivar">@ppid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">ppid</span>
|
186
|
+
448: <span class="ruby-ivar">@thread</span> =
|
187
|
+
449: <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cur</span><span class="ruby-operator">|</span>
|
188
|
+
450: <span class="ruby-keyword kw">begin</span>
|
189
|
+
451: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
190
|
+
452: <span class="ruby-identifier">trace</span>{ <span class="ruby-node">"<#{ @whoami }> <#{ @pid }> puts <#{ @pid }>"</span> }
|
191
|
+
453: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">puts</span> <span class="ruby-ivar">@pid</span>
|
192
|
+
454: <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">kill</span> <span class="ruby-value">0</span>, <span class="ruby-ivar">@ppid</span>
|
193
|
+
455: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@pulse_rate</span>
|
194
|
+
456: <span class="ruby-keyword kw">end</span>
|
195
|
+
457: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
196
|
+
458: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
197
|
+
459: <span class="ruby-keyword kw">ensure</span>
|
198
|
+
460: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
199
|
+
461: <span class="ruby-keyword kw">end</span>
|
200
|
+
462: <span class="ruby-keyword kw">end</span>
|
201
|
+
463: <span class="ruby-comment cmt">#--}}}</span>
|
202
|
+
464: <span class="ruby-keyword kw">end</span>
|
202
203
|
</pre>
|
203
204
|
</div>
|
204
205
|
</div>
|
205
206
|
</div>
|
206
207
|
|
207
|
-
<div id="method-
|
208
|
-
<a name="
|
208
|
+
<div id="method-M000021" class="method-detail">
|
209
|
+
<a name="M000021"></a>
|
209
210
|
|
210
211
|
<div class="method-heading">
|
211
|
-
<a href="#
|
212
|
+
<a href="#M000021" class="method-signature">
|
212
213
|
<span class="method-name">child_start</span><span class="method-args">()</span>
|
213
214
|
</a>
|
214
215
|
</div>
|
215
216
|
|
216
217
|
<div class="method-description">
|
217
218
|
<p><a class="source-toggle" href="#"
|
218
|
-
onclick="toggleCode('
|
219
|
-
<div class="method-source-code" id="
|
219
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
220
|
+
<div class="method-source-code" id="M000021-source">
|
220
221
|
<pre>
|
221
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
222
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 496</span>
|
223
|
+
496: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">child_start</span>
|
224
|
+
497: <span class="ruby-comment cmt">#--{{{</span>
|
225
|
+
498: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'child'</span>
|
226
|
+
499: <span class="ruby-ivar">@pid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span>
|
227
|
+
500: <span class="ruby-ivar">@ppid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">ppid</span>
|
228
|
+
501: <span class="ruby-ivar">@thread</span> =
|
229
|
+
502: <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cur</span><span class="ruby-operator">|</span>
|
230
|
+
503: <span class="ruby-keyword kw">begin</span>
|
231
|
+
504: <span class="ruby-identifier">trace</span>{ <span class="ruby-value str">"child reading..."</span> }
|
232
|
+
505: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">read</span>
|
233
|
+
506: <span class="ruby-identifier">trace</span>{ <span class="ruby-value str">"child read."</span> }
|
234
|
+
507: <span class="ruby-identifier">trace</span>{ <span class="ruby-value str">"child exiting."</span> }
|
235
|
+
508: <span class="ruby-identifier">exit</span>
|
236
|
+
509: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
237
|
+
510: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
238
|
+
511: <span class="ruby-keyword kw">ensure</span>
|
239
|
+
512: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
240
|
+
513: <span class="ruby-keyword kw">end</span>
|
241
|
+
514: <span class="ruby-keyword kw">end</span>
|
242
|
+
515: <span class="ruby-comment cmt">#--}}}</span>
|
243
|
+
516: <span class="ruby-keyword kw">end</span>
|
243
244
|
</pre>
|
244
245
|
</div>
|
245
246
|
</div>
|
246
247
|
</div>
|
247
248
|
|
248
|
-
<div id="method-
|
249
|
-
<a name="
|
249
|
+
<div id="method-M000017" class="method-detail">
|
250
|
+
<a name="M000017"></a>
|
250
251
|
|
251
252
|
<div class="method-heading">
|
252
|
-
<a href="#
|
253
|
+
<a href="#M000017" class="method-signature">
|
253
254
|
<span class="method-name">parent_start</span><span class="method-args">()</span>
|
254
255
|
</a>
|
255
256
|
</div>
|
256
257
|
|
257
258
|
<div class="method-description">
|
258
259
|
<p><a class="source-toggle" href="#"
|
259
|
-
onclick="toggleCode('
|
260
|
-
<div class="method-source-code" id="
|
260
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
261
|
+
<div class="method-source-code" id="M000017-source">
|
261
262
|
<pre>
|
262
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
263
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 424</span>
|
264
|
+
424: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parent_start</span>
|
265
|
+
425: <span class="ruby-comment cmt">#--{{{</span>
|
266
|
+
426: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'parent'</span>
|
267
|
+
427: <span class="ruby-ivar">@thread</span> =
|
268
|
+
428: <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cur</span><span class="ruby-operator">|</span>
|
269
|
+
429: <span class="ruby-keyword kw">begin</span>
|
270
|
+
430: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
271
|
+
431: <span class="ruby-identifier">buf</span> = <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">gets</span>
|
272
|
+
432: <span class="ruby-identifier">trace</span>{ <span class="ruby-node">"<#{ @whoami }> <#{ @pid }> gets <#{ buf.inspect }>"</span> }
|
273
|
+
433: <span class="ruby-ivar">@cid</span> = <span class="ruby-constant">Integer</span> <span class="ruby-identifier">buf</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@cid</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">buf</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%/^\s*\d+\s*$/</span>
|
274
|
+
434: <span class="ruby-keyword kw">end</span>
|
275
|
+
435: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
276
|
+
436: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
277
|
+
437: <span class="ruby-keyword kw">ensure</span>
|
278
|
+
438: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
279
|
+
439: <span class="ruby-keyword kw">end</span>
|
280
|
+
440: <span class="ruby-keyword kw">end</span>
|
281
|
+
441: <span class="ruby-comment cmt">#--}}}</span>
|
282
|
+
442: <span class="ruby-keyword kw">end</span>
|
282
283
|
</pre>
|
283
284
|
</div>
|
284
285
|
</div>
|
285
286
|
</div>
|
286
287
|
|
287
|
-
<div id="method-
|
288
|
-
<a name="
|
288
|
+
<div id="method-M000020" class="method-detail">
|
289
|
+
<a name="M000020"></a>
|
289
290
|
|
290
291
|
<div class="method-heading">
|
291
|
-
<a href="#
|
292
|
+
<a href="#M000020" class="method-signature">
|
292
293
|
<span class="method-name">parent_start</span><span class="method-args">()</span>
|
293
294
|
</a>
|
294
295
|
</div>
|
295
296
|
|
296
297
|
<div class="method-description">
|
297
298
|
<p><a class="source-toggle" href="#"
|
298
|
-
onclick="toggleCode('
|
299
|
-
<div class="method-source-code" id="
|
299
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
300
|
+
<div class="method-source-code" id="M000020-source">
|
300
301
|
<pre>
|
301
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
302
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 481</span>
|
303
|
+
481: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parent_start</span>
|
304
|
+
482: <span class="ruby-comment cmt">#--{{{</span>
|
305
|
+
483: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'parent'</span>
|
306
|
+
484: <span class="ruby-ivar">@thread</span> =
|
307
|
+
485: <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cur</span><span class="ruby-operator">|</span>
|
308
|
+
486: <span class="ruby-keyword kw">begin</span>
|
309
|
+
487: <span class="ruby-identifier">sleep</span>
|
310
|
+
488: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
311
|
+
489: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
312
|
+
490: <span class="ruby-keyword kw">ensure</span>
|
313
|
+
491: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
314
|
+
492: <span class="ruby-keyword kw">end</span>
|
315
|
+
493: <span class="ruby-keyword kw">end</span>
|
316
|
+
494: <span class="ruby-comment cmt">#--}}}</span>
|
317
|
+
495: <span class="ruby-keyword kw">end</span>
|
317
318
|
</pre>
|
318
319
|
</div>
|
319
320
|
</div>
|
320
321
|
</div>
|
321
322
|
|
322
|
-
<div id="method-
|
323
|
-
<a name="
|
323
|
+
<div id="method-M000016" class="method-detail">
|
324
|
+
<a name="M000016"></a>
|
324
325
|
|
325
326
|
<div class="method-heading">
|
326
|
-
<a href="#
|
327
|
+
<a href="#M000016" class="method-signature">
|
327
328
|
<span class="method-name">start</span><span class="method-args">()</span>
|
328
329
|
</a>
|
329
330
|
</div>
|
330
331
|
|
331
332
|
<div class="method-description">
|
332
333
|
<p><a class="source-toggle" href="#"
|
333
|
-
onclick="toggleCode('
|
334
|
-
<div class="method-source-code" id="
|
334
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
335
|
+
<div class="method-source-code" id="M000016-source">
|
335
336
|
<pre>
|
336
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
337
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 409</span>
|
338
|
+
409: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
|
339
|
+
410: <span class="ruby-comment cmt">#--{{{</span>
|
340
|
+
411: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@pid</span>
|
341
|
+
412: <span class="ruby-ivar">@w</span>.<span class="ruby-identifier">close</span>
|
342
|
+
413: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@r</span>
|
343
|
+
414: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">fcntl</span> <span class="ruby-constant">Fcntl</span><span class="ruby-operator">::</span><span class="ruby-constant">F_SETFD</span>, <span class="ruby-constant">Fcntl</span><span class="ruby-operator">::</span><span class="ruby-constant">FD_CLOEXEC</span>
|
344
|
+
415: <span class="ruby-identifier">parent_start</span>
|
345
|
+
416: <span class="ruby-keyword kw">else</span>
|
346
|
+
417: <span class="ruby-ivar">@r</span>.<span class="ruby-identifier">close</span>
|
347
|
+
418: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@w</span>
|
348
|
+
419: <span class="ruby-identifier">child_start</span>
|
349
|
+
420: <span class="ruby-keyword kw">end</span>
|
350
|
+
421: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">true</span>
|
351
|
+
422: <span class="ruby-comment cmt">#--}}}</span>
|
352
|
+
423: <span class="ruby-keyword kw">end</span>
|
352
353
|
</pre>
|
353
354
|
</div>
|
354
355
|
</div>
|
355
356
|
</div>
|
356
357
|
|
357
|
-
<div id="method-
|
358
|
-
<a name="
|
358
|
+
<div id="method-M000019" class="method-detail">
|
359
|
+
<a name="M000019"></a>
|
359
360
|
|
360
361
|
<div class="method-heading">
|
361
|
-
<a href="#
|
362
|
+
<a href="#M000019" class="method-signature">
|
362
363
|
<span class="method-name">start</span><span class="method-args">()</span>
|
363
364
|
</a>
|
364
365
|
</div>
|
365
366
|
|
366
367
|
<div class="method-description">
|
367
368
|
<p><a class="source-toggle" href="#"
|
368
|
-
onclick="toggleCode('
|
369
|
-
<div class="method-source-code" id="
|
369
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
370
|
+
<div class="method-source-code" id="M000019-source">
|
370
371
|
<pre>
|
371
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
372
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 466</span>
|
373
|
+
466: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
|
374
|
+
467: <span class="ruby-comment cmt">#--{{{</span>
|
375
|
+
468: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@pid</span>
|
376
|
+
469: <span class="ruby-ivar">@r</span>.<span class="ruby-identifier">close</span>
|
377
|
+
470: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@w</span>
|
378
|
+
471: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">fcntl</span> <span class="ruby-constant">Fcntl</span><span class="ruby-operator">::</span><span class="ruby-constant">F_SETFD</span>, <span class="ruby-constant">Fcntl</span><span class="ruby-operator">::</span><span class="ruby-constant">FD_CLOEXEC</span>
|
379
|
+
472: <span class="ruby-identifier">parent_start</span>
|
380
|
+
473: <span class="ruby-keyword kw">else</span>
|
381
|
+
474: <span class="ruby-ivar">@w</span>.<span class="ruby-identifier">close</span>
|
382
|
+
475: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@r</span>
|
383
|
+
476: <span class="ruby-identifier">child_start</span>
|
384
|
+
477: <span class="ruby-keyword kw">end</span>
|
385
|
+
478: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">true</span>
|
386
|
+
479: <span class="ruby-comment cmt">#--}}}</span>
|
387
|
+
480: <span class="ruby-keyword kw">end</span>
|
387
388
|
</pre>
|
388
389
|
</div>
|
389
390
|
</div>
|
390
391
|
</div>
|
391
392
|
|
392
|
-
<div id="method-
|
393
|
-
<a name="
|
393
|
+
<div id="method-M000022" class="method-detail">
|
394
|
+
<a name="M000022"></a>
|
394
395
|
|
395
396
|
<div class="method-heading">
|
396
|
-
<a href="#
|
397
|
+
<a href="#M000022" class="method-signature">
|
397
398
|
<span class="method-name">stop</span><span class="method-args">()</span>
|
398
399
|
</a>
|
399
400
|
</div>
|
400
401
|
|
401
402
|
<div class="method-description">
|
402
403
|
<p><a class="source-toggle" href="#"
|
403
|
-
onclick="toggleCode('
|
404
|
-
<div class="method-source-code" id="
|
404
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
405
|
+
<div class="method-source-code" id="M000022-source">
|
405
406
|
<pre>
|
406
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
407
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 517</span>
|
408
|
+
517: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
|
409
|
+
518: <span class="ruby-comment cmt">#--{{{</span>
|
410
|
+
519: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"not beating"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@beating</span>
|
411
|
+
520: <span class="ruby-ivar">@thread</span>.<span class="ruby-identifier">kill</span>
|
412
|
+
521: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
413
|
+
522: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">false</span>
|
414
|
+
523: <span class="ruby-comment cmt">#--}}}</span>
|
415
|
+
524: <span class="ruby-keyword kw">end</span>
|
415
416
|
</pre>
|
416
417
|
</div>
|
417
418
|
</div>
|
418
419
|
</div>
|
419
420
|
|
420
|
-
<div id="method-
|
421
|
-
<a name="
|
421
|
+
<div id="method-M000023" class="method-detail">
|
422
|
+
<a name="M000023"></a>
|
422
423
|
|
423
424
|
<div class="method-heading">
|
424
|
-
<a href="#
|
425
|
+
<a href="#M000023" class="method-signature">
|
425
426
|
<span class="method-name">trace</span><span class="method-args">() {|| ...}</span>
|
426
427
|
</a>
|
427
428
|
</div>
|
428
429
|
|
429
430
|
<div class="method-description">
|
430
431
|
<p><a class="source-toggle" href="#"
|
431
|
-
onclick="toggleCode('
|
432
|
-
<div class="method-source-code" id="
|
432
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
433
|
+
<div class="method-source-code" id="M000023-source">
|
433
434
|
<pre>
|
434
|
-
<span class="ruby-comment cmt"># File lib/slave.rb, line
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
435
|
+
<span class="ruby-comment cmt"># File lib/slave.rb, line 525</span>
|
436
|
+
525: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">trace</span>
|
437
|
+
526: <span class="ruby-comment cmt">#--{{{</span>
|
438
|
+
527: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-keyword kw">yield</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@debug</span> <span class="ruby-keyword kw">and</span> <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">tty?</span>
|
439
|
+
528: <span class="ruby-comment cmt">#--}}}</span>
|
440
|
+
529: <span class="ruby-keyword kw">end</span>
|
440
441
|
</pre>
|
441
442
|
</div>
|
442
443
|
</div>
|