slave 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,7 +75,8 @@
75
75
  <div id="contextContent">
76
76
  <div id="diagram">
77
77
  <map name="map">
78
- <area shape="RECT" coords="28,88,99,40" href="../Slave.html" alt="Slave">
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="#M000014">child_start</a>&nbsp;&nbsp;
101
- <a href="#M000017">child_start</a>&nbsp;&nbsp;
102
- <a href="#M000011">new</a>&nbsp;&nbsp;
103
- <a href="#M000013">parent_start</a>&nbsp;&nbsp;
104
- <a href="#M000016">parent_start</a>&nbsp;&nbsp;
105
- <a href="#M000012">start</a>&nbsp;&nbsp;
106
- <a href="#M000015">start</a>&nbsp;&nbsp;
107
- <a href="#M000018">stop</a>&nbsp;&nbsp;
108
- <a href="#M000019">trace</a>&nbsp;&nbsp;
101
+ <a href="#M000018">child_start</a>&nbsp;&nbsp;
102
+ <a href="#M000021">child_start</a>&nbsp;&nbsp;
103
+ <a href="#M000015">new</a>&nbsp;&nbsp;
104
+ <a href="#M000017">parent_start</a>&nbsp;&nbsp;
105
+ <a href="#M000020">parent_start</a>&nbsp;&nbsp;
106
+ <a href="#M000016">start</a>&nbsp;&nbsp;
107
+ <a href="#M000019">start</a>&nbsp;&nbsp;
108
+ <a href="#M000022">stop</a>&nbsp;&nbsp;
109
+ <a href="#M000023">trace</a>&nbsp;&nbsp;
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-M000011" class="method-detail">
129
- <a name="M000011"></a>
129
+ <div id="method-M000015" class="method-detail">
130
+ <a name="M000015"></a>
130
131
 
131
132
  <div class="method-heading">
132
- <a href="#M000011" class="method-signature">
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('M000011-source');return false;">[Source]</a></p>
140
- <div class="method-source-code" id="M000011-source">
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 264</span>
143
- 264: <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>
144
- 265: <span class="ruby-comment cmt">#--{{{</span>
145
- 266: <span class="ruby-ivar">@pulse_rate</span> = <span class="ruby-constant">Float</span> <span class="ruby-identifier">pulse_rate</span>
146
- 267: <span class="ruby-ivar">@debug</span> = <span class="ruby-identifier">debug</span>
147
- 268: <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>
148
- 269: <span class="ruby-ivar">@pid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span>
149
- 270: <span class="ruby-ivar">@ppid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">ppid</span>
150
- 271: <span class="ruby-ivar">@cid</span> = <span class="ruby-keyword kw">nil</span>
151
- 272: <span class="ruby-ivar">@thread</span> = <span class="ruby-keyword kw">nil</span>
152
- 273: <span class="ruby-ivar">@ppid</span> = <span class="ruby-keyword kw">nil</span>
153
- 274: <span class="ruby-ivar">@whoami</span> = <span class="ruby-keyword kw">nil</span>
154
- 275: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">nil</span>
155
- 276: <span class="ruby-ivar">@pipe</span> = <span class="ruby-keyword kw">nil</span>
156
- 277: <span class="ruby-comment cmt">#--}}}</span>
157
- 278: <span class="ruby-keyword kw">end</span>
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-M000014" class="method-detail">
166
- <a name="M000014"></a>
166
+ <div id="method-M000018" class="method-detail">
167
+ <a name="M000018"></a>
167
168
 
168
169
  <div class="method-heading">
169
- <a href="#M000014" class="method-signature">
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('M000014-source');return false;">[Source]</a></p>
177
- <div class="method-source-code" id="M000014-source">
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 313</span>
180
- 313: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">child_start</span>
181
- 314: <span class="ruby-comment cmt">#--{{{</span>
182
- 315: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'child'</span>
183
- 316: <span class="ruby-ivar">@pid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span>
184
- 317: <span class="ruby-ivar">@ppid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">ppid</span>
185
- 318: <span class="ruby-ivar">@thread</span> =
186
- 319: <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>
187
- 320: <span class="ruby-keyword kw">begin</span>
188
- 321: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
189
- 322: <span class="ruby-identifier">trace</span>{ <span class="ruby-node">&quot;&lt;#{ @whoami }&gt; &lt;#{ @pid }&gt; puts &lt;#{ @pid }&gt;&quot;</span> }
190
- 323: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">puts</span> <span class="ruby-ivar">@pid</span>
191
- 324: <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>
192
- 325: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@pulse_rate</span>
193
- 326: <span class="ruby-keyword kw">end</span>
194
- 327: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
195
- 328: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
196
- 329: <span class="ruby-keyword kw">ensure</span>
197
- 330: <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>
198
- 331: <span class="ruby-keyword kw">end</span>
199
- 332: <span class="ruby-keyword kw">end</span>
200
- 333: <span class="ruby-comment cmt">#--}}}</span>
201
- 334: <span class="ruby-keyword kw">end</span>
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">&quot;&lt;#{ @whoami }&gt; &lt;#{ @pid }&gt; puts &lt;#{ @pid }&gt;&quot;</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">&gt;</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-M000017" class="method-detail">
208
- <a name="M000017"></a>
208
+ <div id="method-M000021" class="method-detail">
209
+ <a name="M000021"></a>
209
210
 
210
211
  <div class="method-heading">
211
- <a href="#M000017" class="method-signature">
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('M000017-source');return false;">[Source]</a></p>
219
- <div class="method-source-code" id="M000017-source">
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 366</span>
222
- 366: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">child_start</span>
223
- 367: <span class="ruby-comment cmt">#--{{{</span>
224
- 368: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'child'</span>
225
- 369: <span class="ruby-ivar">@pid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">pid</span>
226
- 370: <span class="ruby-ivar">@ppid</span> = <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-identifier">ppid</span>
227
- 371: <span class="ruby-ivar">@thread</span> =
228
- 372: <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>
229
- 373: <span class="ruby-keyword kw">begin</span>
230
- 374: <span class="ruby-identifier">trace</span>{ <span class="ruby-value str">&quot;child reading...&quot;</span> }
231
- 375: <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">read</span>
232
- 376: <span class="ruby-identifier">trace</span>{ <span class="ruby-value str">&quot;child read.&quot;</span> }
233
- 377: <span class="ruby-identifier">trace</span>{ <span class="ruby-value str">&quot;child exiting.&quot;</span> }
234
- 378: <span class="ruby-identifier">exit!</span>
235
- 379: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
236
- 380: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
237
- 381: <span class="ruby-keyword kw">ensure</span>
238
- 382: <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>
239
- 383: <span class="ruby-keyword kw">end</span>
240
- 384: <span class="ruby-keyword kw">end</span>
241
- 385: <span class="ruby-comment cmt">#--}}}</span>
242
- 386: <span class="ruby-keyword kw">end</span>
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">&quot;child reading...&quot;</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">&quot;child read.&quot;</span> }
234
+ 507: <span class="ruby-identifier">trace</span>{ <span class="ruby-value str">&quot;child exiting.&quot;</span> }
235
+ 508: <span class="ruby-identifier">exit</span>
236
+ 509: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</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-M000013" class="method-detail">
249
- <a name="M000013"></a>
249
+ <div id="method-M000017" class="method-detail">
250
+ <a name="M000017"></a>
250
251
 
251
252
  <div class="method-heading">
252
- <a href="#M000013" class="method-signature">
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('M000013-source');return false;">[Source]</a></p>
260
- <div class="method-source-code" id="M000013-source">
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 294</span>
263
- 294: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parent_start</span>
264
- 295: <span class="ruby-comment cmt">#--{{{</span>
265
- 296: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'parent'</span>
266
- 297: <span class="ruby-ivar">@thread</span> =
267
- 298: <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>
268
- 299: <span class="ruby-keyword kw">begin</span>
269
- 300: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
270
- 301: <span class="ruby-identifier">buf</span> = <span class="ruby-ivar">@pipe</span>.<span class="ruby-identifier">gets</span>
271
- 302: <span class="ruby-identifier">trace</span>{ <span class="ruby-node">&quot;&lt;#{ @whoami }&gt; &lt;#{ @pid }&gt; gets &lt;#{ buf.inspect }&gt;&quot;</span> }
272
- 303: <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>
273
- 304: <span class="ruby-keyword kw">end</span>
274
- 305: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
275
- 306: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
276
- 307: <span class="ruby-keyword kw">ensure</span>
277
- 308: <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>
278
- 309: <span class="ruby-keyword kw">end</span>
279
- 310: <span class="ruby-keyword kw">end</span>
280
- 311: <span class="ruby-comment cmt">#--}}}</span>
281
- 312: <span class="ruby-keyword kw">end</span>
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">&quot;&lt;#{ @whoami }&gt; &lt;#{ @pid }&gt; gets &lt;#{ buf.inspect }&gt;&quot;</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">&gt;</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-M000016" class="method-detail">
288
- <a name="M000016"></a>
288
+ <div id="method-M000020" class="method-detail">
289
+ <a name="M000020"></a>
289
290
 
290
291
  <div class="method-heading">
291
- <a href="#M000016" class="method-signature">
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('M000016-source');return false;">[Source]</a></p>
299
- <div class="method-source-code" id="M000016-source">
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 351</span>
302
- 351: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parent_start</span>
303
- 352: <span class="ruby-comment cmt">#--{{{</span>
304
- 353: <span class="ruby-ivar">@whoami</span> = <span class="ruby-value str">'parent'</span>
305
- 354: <span class="ruby-ivar">@thread</span> =
306
- 355: <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>
307
- 356: <span class="ruby-keyword kw">begin</span>
308
- 357: <span class="ruby-identifier">sleep</span>
309
- 358: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
310
- 359: <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
311
- 360: <span class="ruby-keyword kw">ensure</span>
312
- 361: <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>
313
- 362: <span class="ruby-keyword kw">end</span>
314
- 363: <span class="ruby-keyword kw">end</span>
315
- 364: <span class="ruby-comment cmt">#--}}}</span>
316
- 365: <span class="ruby-keyword kw">end</span>
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">&gt;</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-M000012" class="method-detail">
323
- <a name="M000012"></a>
323
+ <div id="method-M000016" class="method-detail">
324
+ <a name="M000016"></a>
324
325
 
325
326
  <div class="method-heading">
326
- <a href="#M000012" class="method-signature">
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('M000012-source');return false;">[Source]</a></p>
334
- <div class="method-source-code" id="M000012-source">
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 279</span>
337
- 279: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
338
- 280: <span class="ruby-comment cmt">#--{{{</span>
339
- 281: <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>
340
- 282: <span class="ruby-ivar">@w</span>.<span class="ruby-identifier">close</span>
341
- 283: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@r</span>
342
- 284: <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>
343
- 285: <span class="ruby-identifier">parent_start</span>
344
- 286: <span class="ruby-keyword kw">else</span>
345
- 287: <span class="ruby-ivar">@r</span>.<span class="ruby-identifier">close</span>
346
- 288: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@w</span>
347
- 289: <span class="ruby-identifier">child_start</span>
348
- 290: <span class="ruby-keyword kw">end</span>
349
- 291: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">true</span>
350
- 292: <span class="ruby-comment cmt">#--}}}</span>
351
- 293: <span class="ruby-keyword kw">end</span>
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-M000015" class="method-detail">
358
- <a name="M000015"></a>
358
+ <div id="method-M000019" class="method-detail">
359
+ <a name="M000019"></a>
359
360
 
360
361
  <div class="method-heading">
361
- <a href="#M000015" class="method-signature">
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('M000015-source');return false;">[Source]</a></p>
369
- <div class="method-source-code" id="M000015-source">
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 336</span>
372
- 336: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
373
- 337: <span class="ruby-comment cmt">#--{{{</span>
374
- 338: <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>
375
- 339: <span class="ruby-ivar">@r</span>.<span class="ruby-identifier">close</span>
376
- 340: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@w</span>
377
- 341: <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>
378
- 342: <span class="ruby-identifier">parent_start</span>
379
- 343: <span class="ruby-keyword kw">else</span>
380
- 344: <span class="ruby-ivar">@w</span>.<span class="ruby-identifier">close</span>
381
- 345: <span class="ruby-ivar">@pipe</span> = <span class="ruby-ivar">@r</span>
382
- 346: <span class="ruby-identifier">child_start</span>
383
- 347: <span class="ruby-keyword kw">end</span>
384
- 348: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">true</span>
385
- 349: <span class="ruby-comment cmt">#--}}}</span>
386
- 350: <span class="ruby-keyword kw">end</span>
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-M000018" class="method-detail">
393
- <a name="M000018"></a>
393
+ <div id="method-M000022" class="method-detail">
394
+ <a name="M000022"></a>
394
395
 
395
396
  <div class="method-heading">
396
- <a href="#M000018" class="method-signature">
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('M000018-source');return false;">[Source]</a></p>
404
- <div class="method-source-code" id="M000018-source">
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 387</span>
407
- 387: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
408
- 388: <span class="ruby-comment cmt">#--{{{</span>
409
- 389: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;not beating&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@beating</span>
410
- 390: <span class="ruby-ivar">@thread</span>.<span class="ruby-identifier">kill</span>
411
- 391: <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>
412
- 392: <span class="ruby-ivar">@beating</span> = <span class="ruby-keyword kw">false</span>
413
- 393: <span class="ruby-comment cmt">#--}}}</span>
414
- 394: <span class="ruby-keyword kw">end</span>
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">&quot;not beating&quot;</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-M000019" class="method-detail">
421
- <a name="M000019"></a>
421
+ <div id="method-M000023" class="method-detail">
422
+ <a name="M000023"></a>
422
423
 
423
424
  <div class="method-heading">
424
- <a href="#M000019" class="method-signature">
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('M000019-source');return false;">[Source]</a></p>
432
- <div class="method-source-code" id="M000019-source">
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 395</span>
435
- 395: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">trace</span>
436
- 396: <span class="ruby-comment cmt">#--{{{</span>
437
- 397: <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>
438
- 398: <span class="ruby-comment cmt">#--}}}</span>
439
- 399: <span class="ruby-keyword kw">end</span>
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>