rumai 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/bin/rumai +1 -1
  2. data/doc/api/classes/Integer.html +7 -7
  3. data/doc/api/classes/Rumai.html +148 -141
  4. data/doc/api/classes/Rumai/Area.html +135 -130
  5. data/doc/api/classes/Rumai/Chain.html +21 -21
  6. data/doc/api/classes/Rumai/Client.html +188 -189
  7. data/doc/api/classes/Rumai/ClientContainer.html +22 -22
  8. data/doc/api/classes/Rumai/IXP/Agent.html +248 -143
  9. data/doc/api/classes/Rumai/IXP/Agent/FidStream.html +50 -50
  10. data/doc/api/classes/Rumai/IXP/Agent/MODES.html +7 -7
  11. data/doc/api/classes/Rumai/IXP/Agent/RangedPool.html +21 -21
  12. data/doc/api/classes/Rumai/IXP/Fcall.html +33 -33
  13. data/doc/api/classes/Rumai/IXP/Qid.html +1 -1
  14. data/doc/api/classes/Rumai/IXP/Stat.html +8 -8
  15. data/doc/api/classes/Rumai/IXP/Stream.html +6 -6
  16. data/doc/api/classes/Rumai/IXP/Struct.html +34 -38
  17. data/doc/api/classes/Rumai/IXP/Struct/Field.html +42 -42
  18. data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.html +14 -14
  19. data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.html +7 -7
  20. data/doc/api/classes/Rumai/IXP/Terror.html +7 -7
  21. data/doc/api/classes/Rumai/IXP/Topen.html +1 -1
  22. data/doc/api/classes/Rumai/Node.html +114 -110
  23. data/doc/api/classes/Rumai/View.html +184 -136
  24. data/doc/api/classes/String.html +15 -15
  25. data/doc/api/classes/Time.html +14 -14
  26. data/doc/api/created.rid +1 -1
  27. data/doc/api/files/lib/rumai/fs_rb.html +1 -1
  28. data/doc/api/files/lib/rumai/ixp/message_rb.html +1 -1
  29. data/doc/api/files/lib/rumai/ixp/transport_rb.html +1 -1
  30. data/doc/api/files/lib/rumai/wm_rb.html +1 -1
  31. data/doc/api/files/lib/rumai_rb.html +1 -1
  32. data/doc/api/panel/search_index.js +1 -1
  33. data/doc/history.erb +41 -0
  34. data/doc/index.html +1315 -669
  35. data/doc/setup.erb +82 -45
  36. data/doc/usage.erb +96 -132
  37. data/lib/rumai.rb +2 -2
  38. data/lib/rumai/fs.rb +11 -6
  39. data/lib/rumai/ixp/message.rb +31 -17
  40. data/lib/rumai/ixp/transport.rb +82 -36
  41. data/lib/rumai/wm.rb +87 -25
  42. metadata +5 -5
@@ -31,7 +31,7 @@
31
31
  <div class="description">
32
32
  <p>
33
33
  NOTE: Inheritors should override the &#8216;<a
34
- href="ClientContainer.html#M000059">client_ids</a>&#8217; method.
34
+ href="ClientContainer.html#M000068">client_ids</a>&#8217; method.
35
35
  </p>
36
36
 
37
37
  </div>
@@ -51,9 +51,9 @@ href="ClientContainer.html#M000059">client_ids</a>&#8217; method.
51
51
  <dd>
52
52
  <ul>
53
53
 
54
- <li><a href="#M000059">client_ids</a>,</li>
54
+ <li><a href="#M000068">client_ids</a>,</li>
55
55
 
56
- <li><a href="#M000060">clients</a></li>
56
+ <li><a href="#M000069">clients</a></li>
57
57
 
58
58
  </ul>
59
59
  </dd>
@@ -62,7 +62,7 @@ href="ClientContainer.html#M000059">client_ids</a>&#8217; method.
62
62
  <dd>
63
63
  <ul>
64
64
 
65
- <li><a href="#M000061">grouping</a></li>
65
+ <li><a href="#M000071">grouping</a></li>
66
66
 
67
67
  </ul>
68
68
  </dd>
@@ -84,9 +84,9 @@ href="ClientContainer.html#M000059">client_ids</a>&#8217; method.
84
84
  <div class="sectiontitle">Instance Public methods</div>
85
85
 
86
86
  <div class="method">
87
- <div class="title" id="M000059">
87
+ <div class="title" id="M000068">
88
88
 
89
- <a name="M000059"></a><b>client_ids</b>()
89
+ <a name="M000068"></a><b>client_ids</b>()
90
90
 
91
91
  </div>
92
92
 
@@ -102,13 +102,13 @@ Returns the IDs of the clients in this container.
102
102
 
103
103
  <div class="sourcecode">
104
104
  <p class="source-link">
105
- Source: <a href="javascript:toggleSource('M000059_source')" id="l_M000059_source">show</a>
105
+ Source: <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show</a>
106
106
 
107
- | <a href="http://github.com/sunaku/rumai/blob/68157cba221ac3cbed28a6a5882b57f4db0516a9/lib/rumai/wm.rb#L449" target="_blank" class="github_url">on GitHub</a>
107
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/wm.rb#L458" target="_blank" class="github_url">on GitHub</a>
108
108
 
109
109
  </p>
110
- <div id="M000059_source" class="dyn-source">
111
- <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 449</span>
110
+ <div id="M000068_source" class="dyn-source">
111
+ <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 458</span>
112
112
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client_ids</span>
113
113
  []
114
114
  <span class="ruby-keyword kw">end</span></pre>
@@ -118,9 +118,9 @@ Returns the IDs of the clients in this container.
118
118
  </div>
119
119
 
120
120
  <div class="method">
121
- <div class="title" id="M000060">
121
+ <div class="title" id="M000069">
122
122
 
123
- <a name="M000060"></a><b>clients</b>()
123
+ <a name="M000069"></a><b>clients</b>()
124
124
 
125
125
  </div>
126
126
 
@@ -136,13 +136,13 @@ Returns the clients contained in this container.
136
136
 
137
137
  <div class="sourcecode">
138
138
  <p class="source-link">
139
- Source: <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show</a>
139
+ Source: <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show</a>
140
140
 
141
- | <a href="http://github.com/sunaku/rumai/blob/68157cba221ac3cbed28a6a5882b57f4db0516a9/lib/rumai/wm.rb#L456" target="_blank" class="github_url">on GitHub</a>
141
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/wm.rb#L465" target="_blank" class="github_url">on GitHub</a>
142
142
 
143
143
  </p>
144
- <div id="M000060_source" class="dyn-source">
145
- <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 456</span>
144
+ <div id="M000069_source" class="dyn-source">
145
+ <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 465</span>
146
146
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clients</span>
147
147
  <span class="ruby-identifier">client_ids</span>.<span class="ruby-identifier">map!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">i</span> }
148
148
  <span class="ruby-keyword kw">end</span></pre>
@@ -152,9 +152,9 @@ Returns the clients contained in this container.
152
152
  </div>
153
153
 
154
154
  <div class="method">
155
- <div class="title" id="M000061">
155
+ <div class="title" id="M000071">
156
156
 
157
- <a name="M000061"></a><b>grouping</b>()
157
+ <a name="M000071"></a><b>grouping</b>()
158
158
 
159
159
  </div>
160
160
 
@@ -170,13 +170,13 @@ Returns all grouped clients in this container.
170
170
 
171
171
  <div class="sourcecode">
172
172
  <p class="source-link">
173
- Source: <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show</a>
173
+ Source: <a href="javascript:toggleSource('M000071_source')" id="l_M000071_source">show</a>
174
174
 
175
- | <a href="http://github.com/sunaku/rumai/blob/68157cba221ac3cbed28a6a5882b57f4db0516a9/lib/rumai/wm.rb#L472" target="_blank" class="github_url">on GitHub</a>
175
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/wm.rb#L481" target="_blank" class="github_url">on GitHub</a>
176
176
 
177
177
  </p>
178
- <div id="M000061_source" class="dyn-source">
179
- <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 472</span>
178
+ <div id="M000071_source" class="dyn-source">
179
+ <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 481</span>
180
180
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">grouping</span>
181
181
  <span class="ruby-identifier">clients</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">group?</span> }
182
182
  <span class="ruby-keyword kw">end</span></pre>
@@ -36,8 +36,12 @@
36
36
 
37
37
  <div class="description">
38
38
  <p>
39
- A thread-safe proxy that multiplexes many threads onto a single 9P2000
39
+ A thread-safe channel that multiplexes many threads onto a single 9P2000
40
40
  connection.
41
+ </p>
42
+ <p>
43
+ The send/recv implementation is based on the XCB cookie approach: <a
44
+ href="http://www.x.org/releases/X11R7.5/doc/libxcb/tutorial/#requestsreplies">www.x.org/releases/X11R7.5/doc/libxcb/tutorial/#requestsreplies</a>
41
45
  </p>
42
46
 
43
47
  </div>
@@ -57,7 +61,7 @@ connection.
57
61
  <dd>
58
62
  <ul>
59
63
 
60
- <li><a href="#M000172">attach</a></li>
64
+ <li><a href="#M000105">attach</a></li>
61
65
 
62
66
  </ul>
63
67
  </dd>
@@ -66,9 +70,9 @@ connection.
66
70
  <dd>
67
71
  <ul>
68
72
 
69
- <li><a href="#M000173">clunk</a>,</li>
73
+ <li><a href="#M000108">clunk</a>,</li>
70
74
 
71
- <li><a href="#M000160">create</a></li>
75
+ <li><a href="#M000089">create</a></li>
72
76
 
73
77
  </ul>
74
78
  </dd>
@@ -77,7 +81,7 @@ connection.
77
81
  <dd>
78
82
  <ul>
79
83
 
80
- <li><a href="#M000158">entries</a></li>
84
+ <li><a href="#M000084">entries</a></li>
81
85
 
82
86
  </ul>
83
87
  </dd>
@@ -86,7 +90,7 @@ connection.
86
90
  <dd>
87
91
  <ul>
88
92
 
89
- <li><a href="#M000086">new</a></li>
93
+ <li><a href="#M000038">new</a></li>
90
94
 
91
95
  </ul>
92
96
  </dd>
@@ -95,7 +99,7 @@ connection.
95
99
  <dd>
96
100
  <ul>
97
101
 
98
- <li><a href="#M000107">open</a></li>
102
+ <li><a href="#M000064">open</a></li>
99
103
 
100
104
  </ul>
101
105
  </dd>
@@ -104,11 +108,13 @@ connection.
104
108
  <dd>
105
109
  <ul>
106
110
 
107
- <li><a href="#M000157">read</a>,</li>
111
+ <li><a href="#M000083">read</a>,</li>
112
+
113
+ <li><a href="#M000055">recv</a>,</li>
108
114
 
109
- <li><a href="#M000162">remove</a>,</li>
115
+ <li><a href="#M000093">remove</a>,</li>
110
116
 
111
- <li><a href="#M000163">remove_fid</a></li>
117
+ <li><a href="#M000096">remove_fid</a></li>
112
118
 
113
119
  </ul>
114
120
  </dd>
@@ -117,9 +123,11 @@ connection.
117
123
  <dd>
118
124
  <ul>
119
125
 
120
- <li><a href="#M000167">stat</a>,</li>
126
+ <li><a href="#M000054">send</a>,</li>
121
127
 
122
- <li><a href="#M000168">stat_fid</a></li>
128
+ <li><a href="#M000097">stat</a>,</li>
129
+
130
+ <li><a href="#M000098">stat_fid</a></li>
123
131
 
124
132
  </ul>
125
133
  </dd>
@@ -128,7 +136,7 @@ connection.
128
136
  <dd>
129
137
  <ul>
130
138
 
131
- <li><a href="#M000099">talk</a></li>
139
+ <li><a href="#M000057">talk</a></li>
132
140
 
133
141
  </ul>
134
142
  </dd>
@@ -137,11 +145,11 @@ connection.
137
145
  <dd>
138
146
  <ul>
139
147
 
140
- <li><a href="#M000169">walk</a>,</li>
148
+ <li><a href="#M000101">walk</a>,</li>
141
149
 
142
- <li><a href="#M000170">walk_fid</a>,</li>
150
+ <li><a href="#M000102">walk_fid</a>,</li>
143
151
 
144
- <li><a href="#M000159">write</a></li>
152
+ <li><a href="#M000085">write</a></li>
145
153
 
146
154
  </ul>
147
155
  </dd>
@@ -199,37 +207,38 @@ connection.
199
207
  <div class="sectiontitle">Class Public methods</div>
200
208
 
201
209
  <div class="method">
202
- <div class="title" id="M000086">
210
+ <div class="title" id="M000038">
203
211
 
204
- <a name="M000086"></a><b>new</b>(stream)
212
+ <a name="M000038"></a><b>new</b>(stream)
205
213
 
206
214
  </div>
207
215
 
216
+ <div class="description">
217
+ <dl>
218
+ <dt>stream</dt><dd>I/O stream on which a 9P2000 server is listening.
219
+
220
+ </dd>
221
+ </dl>
222
+
223
+ </div>
224
+
208
225
 
209
226
 
210
227
 
211
228
  <div class="sourcecode">
212
229
  <p class="source-link">
213
- Source: <a href="javascript:toggleSource('M000086_source')" id="l_M000086_source">show</a>
230
+ Source: <a href="javascript:toggleSource('M000038_source')" id="l_M000038_source">show</a>
214
231
 
215
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L19" target="_blank" class="github_url">on GitHub</a>
232
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L26" target="_blank" class="github_url">on GitHub</a>
216
233
 
217
234
  </p>
218
- <div id="M000086_source" class="dyn-source">
219
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 19</span>
235
+ <div id="M000038_source" class="dyn-source">
236
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 26</span>
220
237
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">stream</span>
221
- <span class="ruby-ivar">@stream</span> = <span class="ruby-identifier">stream</span>
222
- <span class="ruby-ivar">@send_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
223
- <span class="ruby-ivar">@recv_bays</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span> } <span class="ruby-comment cmt"># tag =&gt; Queue(message)</span>
224
-
225
- <span class="ruby-comment cmt"># background thread which continuously receives</span>
226
- <span class="ruby-comment cmt"># and dispatches messages from the 9P2000 server</span>
227
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
228
- <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
229
- <span class="ruby-identifier">msg</span> = <span class="ruby-constant">Fcall</span>.<span class="ruby-identifier">from_9p</span> <span class="ruby-ivar">@stream</span>
230
- <span class="ruby-ivar">@recv_bays</span>[<span class="ruby-identifier">msg</span>.<span class="ruby-identifier">tag</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">msg</span>
231
- <span class="ruby-keyword kw">end</span>
232
- <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">priority</span> = <span class="ruby-value">-1</span>
238
+ <span class="ruby-ivar">@stream</span> = <span class="ruby-identifier">stream</span>
239
+
240
+ <span class="ruby-ivar">@recv_buf</span> = {} <span class="ruby-comment cmt"># tag =&gt; message</span>
241
+ <span class="ruby-ivar">@recv_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
233
242
 
234
243
  <span class="ruby-ivar">@tag_pool</span> = <span class="ruby-constant">RangedPool</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-constant">BYTE2_MASK</span>)
235
244
  <span class="ruby-ivar">@fid_pool</span> = <span class="ruby-constant">RangedPool</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-constant">BYTE4_MASK</span>)
@@ -263,9 +272,9 @@ connection.
263
272
  <div class="sectiontitle">Instance Public methods</div>
264
273
 
265
274
  <div class="method">
266
- <div class="title" id="M000172">
275
+ <div class="title" id="M000105">
267
276
 
268
- <a name="M000172"></a><b>attach</b>(root_fid, auth_fid = Fcall::NOFID, auth_name = ENV['USER'])
277
+ <a name="M000105"></a><b>attach</b>(root_fid, auth_fid = Fcall::NOFID, auth_name = ENV['USER'])
269
278
 
270
279
  </div>
271
280
 
@@ -281,13 +290,13 @@ Associates the given FID with the FS root.
281
290
 
282
291
  <div class="sourcecode">
283
292
  <p class="source-link">
284
- Source: <a href="javascript:toggleSource('M000172_source')" id="l_M000172_source">show</a>
293
+ Source: <a href="javascript:toggleSource('M000105_source')" id="l_M000105_source">show</a>
285
294
 
286
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L413" target="_blank" class="github_url">on GitHub</a>
295
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L459" target="_blank" class="github_url">on GitHub</a>
287
296
 
288
297
  </p>
289
- <div id="M000172_source" class="dyn-source">
290
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 413</span>
298
+ <div id="M000105_source" class="dyn-source">
299
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 459</span>
291
300
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attach</span> <span class="ruby-identifier">root_fid</span>, <span class="ruby-identifier">auth_fid</span> = <span class="ruby-constant">Fcall</span><span class="ruby-operator">::</span><span class="ruby-constant">NOFID</span>, <span class="ruby-identifier">auth_name</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'USER'</span>]
292
301
  <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tattach</span>.<span class="ruby-identifier">new</span>(
293
302
  <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">root_fid</span>,
@@ -302,9 +311,9 @@ Associates the given FID with the FS root.
302
311
  </div>
303
312
 
304
313
  <div class="method">
305
- <div class="title" id="M000173">
314
+ <div class="title" id="M000108">
306
315
 
307
- <a name="M000173"></a><b>clunk</b>(fid)
316
+ <a name="M000108"></a><b>clunk</b>(fid)
308
317
 
309
318
  </div>
310
319
 
@@ -320,13 +329,13 @@ Retires the given FID from use.
320
329
 
321
330
  <div class="sourcecode">
322
331
  <p class="source-link">
323
- Source: <a href="javascript:toggleSource('M000173_source')" id="l_M000173_source">show</a>
332
+ Source: <a href="javascript:toggleSource('M000108_source')" id="l_M000108_source">show</a>
324
333
 
325
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L425" target="_blank" class="github_url">on GitHub</a>
334
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L471" target="_blank" class="github_url">on GitHub</a>
326
335
 
327
336
  </p>
328
- <div id="M000173_source" class="dyn-source">
329
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 425</span>
337
+ <div id="M000108_source" class="dyn-source">
338
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 471</span>
330
339
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clunk</span> <span class="ruby-identifier">fid</span>
331
340
  <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tclunk</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">fid</span>)
332
341
  <span class="ruby-ivar">@fid_pool</span>.<span class="ruby-identifier">release</span> <span class="ruby-identifier">fid</span>
@@ -337,9 +346,9 @@ Retires the given FID from use.
337
346
  </div>
338
347
 
339
348
  <div class="method">
340
- <div class="title" id="M000160">
349
+ <div class="title" id="M000089">
341
350
 
342
- <a name="M000160"></a><b>create</b>(path, mode = 'rw', perm = 0644)
351
+ <a name="M000089"></a><b>create</b>(path, mode = 'rw', perm = 0644)
343
352
 
344
353
  </div>
345
354
 
@@ -356,13 +365,13 @@ modes for a user having the given permission bits.
356
365
 
357
366
  <div class="sourcecode">
358
367
  <p class="source-link">
359
- Source: <a href="javascript:toggleSource('M000160_source')" id="l_M000160_source">show</a>
368
+ Source: <a href="javascript:toggleSource('M000089_source')" id="l_M000089_source">show</a>
360
369
 
361
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L336" target="_blank" class="github_url">on GitHub</a>
370
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L382" target="_blank" class="github_url">on GitHub</a>
362
371
 
363
372
  </p>
364
- <div id="M000160_source" class="dyn-source">
365
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 336</span>
373
+ <div id="M000089_source" class="dyn-source">
374
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 382</span>
366
375
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-value str">'rw'</span>, <span class="ruby-identifier">perm</span> = <span class="ruby-value">0644</span>
367
376
  <span class="ruby-identifier">prefix</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">path</span>)
368
377
  <span class="ruby-identifier">target</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>)
@@ -387,15 +396,18 @@ modes for a user having the given permission bits.
387
396
  </div>
388
397
 
389
398
  <div class="method">
390
- <div class="title" id="M000158">
399
+ <div class="title" id="M000084">
391
400
 
392
- <a name="M000158"></a><b>entries</b>(path)
401
+ <a name="M000084"></a><b>entries</b>(path)
393
402
 
394
403
  </div>
395
404
 
396
405
  <div class="description">
397
406
  <p>
398
- Returns the names of all files inside the directory whose path is given.
407
+ Returns the basenames of all files inside the directory at the given path.
408
+ </p>
409
+ <p>
410
+ See Dir::entries in the Ruby documentation.
399
411
  </p>
400
412
 
401
413
  </div>
@@ -405,13 +417,13 @@ Returns the names of all files inside the directory whose path is given.
405
417
 
406
418
  <div class="sourcecode">
407
419
  <p class="source-link">
408
- Source: <a href="javascript:toggleSource('M000158_source')" id="l_M000158_source">show</a>
420
+ Source: <a href="javascript:toggleSource('M000084_source')" id="l_M000084_source">show</a>
409
421
 
410
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L315" target="_blank" class="github_url">on GitHub</a>
422
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L360" target="_blank" class="github_url">on GitHub</a>
411
423
 
412
424
  </p>
413
- <div id="M000158_source" class="dyn-source">
414
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 315</span>
425
+ <div id="M000084_source" class="dyn-source">
426
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 360</span>
415
427
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entries</span> <span class="ruby-identifier">path</span>
416
428
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">stat</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">directory?</span>
417
429
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;#{path.inspect} is not a directory&quot;</span>
@@ -425,9 +437,9 @@ Returns the names of all files inside the directory whose path is given.
425
437
  </div>
426
438
 
427
439
  <div class="method">
428
- <div class="title" id="M000107">
440
+ <div class="title" id="M000064">
429
441
 
430
- <a name="M000107"></a><b>open</b>(path, mode = 'r')
442
+ <a name="M000064"></a><b>open</b>(path, mode = 'r')
431
443
 
432
444
  </div>
433
445
 
@@ -449,13 +461,13 @@ See File::open in the Ruby documentation.
449
461
 
450
462
  <div class="sourcecode">
451
463
  <p class="source-link">
452
- Source: <a href="javascript:toggleSource('M000107_source')" id="l_M000107_source">show</a>
464
+ Source: <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show</a>
453
465
 
454
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L157" target="_blank" class="github_url">on GitHub</a>
466
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L199" target="_blank" class="github_url">on GitHub</a>
455
467
 
456
468
  </p>
457
- <div id="M000107_source" class="dyn-source">
458
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 157</span>
469
+ <div id="M000064_source" class="dyn-source">
470
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 199</span>
459
471
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-value str">'r'</span> <span class="ruby-comment cmt"># :yields: FidStream</span>
460
472
  <span class="ruby-identifier">mode</span> = <span class="ruby-constant">MODES</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">mode</span>)
461
473
 
@@ -486,9 +498,9 @@ See File::open in the Ruby documentation.
486
498
  </div>
487
499
 
488
500
  <div class="method">
489
- <div class="title" id="M000157">
501
+ <div class="title" id="M000083">
490
502
 
491
- <a name="M000157"></a><b>read</b>(path, *args)
503
+ <a name="M000083"></a><b>read</b>(path, *args)
492
504
 
493
505
  </div>
494
506
 
@@ -504,13 +516,13 @@ Returns the content of the file/directory at the given path.
504
516
 
505
517
  <div class="sourcecode">
506
518
  <p class="source-link">
507
- Source: <a href="javascript:toggleSource('M000157_source')" id="l_M000157_source">show</a>
519
+ Source: <a href="javascript:toggleSource('M000083_source')" id="l_M000083_source">show</a>
508
520
 
509
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L306" target="_blank" class="github_url">on GitHub</a>
521
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L348" target="_blank" class="github_url">on GitHub</a>
510
522
 
511
523
  </p>
512
- <div id="M000157_source" class="dyn-source">
513
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 306</span>
524
+ <div id="M000083_source" class="dyn-source">
525
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 348</span>
514
526
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span> <span class="ruby-identifier">path</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
515
527
  <span class="ruby-identifier">open</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
516
528
  <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
@@ -522,9 +534,77 @@ Returns the content of the file/directory at the given path.
522
534
  </div>
523
535
 
524
536
  <div class="method">
525
- <div class="title" id="M000162">
537
+ <div class="title" id="M000055">
538
+
539
+ <a name="M000055"></a><b>recv</b>(tag)
540
+
541
+ </div>
542
+
543
+ <div class="description">
544
+ <p>
545
+ Returns the reply for the given ticket, which was previously given to you
546
+ when you sent the corresponding request (<a
547
+ href="Fcall.html">Rumai::IXP::Fcall</a>).
548
+ </p>
549
+
550
+ </div>
551
+
552
+
553
+
554
+
555
+ <div class="sourcecode">
556
+ <p class="source-link">
557
+ Source: <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show</a>
558
+
559
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L124" target="_blank" class="github_url">on GitHub</a>
560
+
561
+ </p>
562
+ <div id="M000055_source" class="dyn-source">
563
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 124</span>
564
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recv</span> <span class="ruby-identifier">tag</span>
565
+ <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
566
+ <span class="ruby-identifier">reply</span> = <span class="ruby-ivar">@recv_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
567
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@recv_buf</span>.<span class="ruby-identifier">key?</span> <span class="ruby-identifier">tag</span>
568
+ <span class="ruby-ivar">@recv_buf</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">tag</span>
569
+ <span class="ruby-keyword kw">else</span>
570
+ <span class="ruby-comment cmt"># reply was not in the receive buffer, so wait</span>
571
+ <span class="ruby-comment cmt"># for the next reply... hoping that it is ours</span>
572
+ <span class="ruby-identifier">msg</span> = <span class="ruby-constant">Fcall</span>.<span class="ruby-identifier">from_9p</span>(<span class="ruby-ivar">@stream</span>)
573
+
574
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">tag</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">tag</span>
575
+ <span class="ruby-identifier">msg</span>
576
+ <span class="ruby-keyword kw">else</span>
577
+ <span class="ruby-comment cmt"># we got someone else's reply, so buffer</span>
578
+ <span class="ruby-comment cmt"># it (for them to receive) and try again</span>
579
+ <span class="ruby-ivar">@recv_buf</span>[<span class="ruby-identifier">msg</span>.<span class="ruby-identifier">tag</span>] = <span class="ruby-identifier">msg</span>
580
+ <span class="ruby-keyword kw">nil</span>
581
+ <span class="ruby-keyword kw">end</span>
582
+ <span class="ruby-keyword kw">end</span>
583
+ <span class="ruby-keyword kw">end</span>
584
+
585
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reply</span>
586
+ <span class="ruby-ivar">@tag_pool</span>.<span class="ruby-identifier">release</span> <span class="ruby-identifier">tag</span>
587
+
588
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reply</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Rerror</span>
589
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-identifier">reply</span>.<span class="ruby-identifier">ename</span>
590
+ <span class="ruby-keyword kw">end</span>
591
+
592
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">reply</span>
593
+ <span class="ruby-keyword kw">else</span>
594
+ <span class="ruby-comment cmt"># give other threads a chance to receive</span>
595
+ <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">pass</span>
596
+ <span class="ruby-keyword kw">end</span>
597
+ <span class="ruby-keyword kw">end</span>
598
+ <span class="ruby-keyword kw">end</span></pre>
599
+ </div>
600
+ </div>
601
+
602
+ </div>
603
+
604
+ <div class="method">
605
+ <div class="title" id="M000093">
526
606
 
527
- <a name="M000162"></a><b>remove</b>(path)
607
+ <a name="M000093"></a><b>remove</b>(path)
528
608
 
529
609
  </div>
530
610
 
@@ -540,13 +620,13 @@ Deletes the file at the given path.
540
620
 
541
621
  <div class="sourcecode">
542
622
  <p class="source-link">
543
- Source: <a href="javascript:toggleSource('M000162_source')" id="l_M000162_source">show</a>
623
+ Source: <a href="javascript:toggleSource('M000093_source')" id="l_M000093_source">show</a>
544
624
 
545
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L358" target="_blank" class="github_url">on GitHub</a>
625
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L404" target="_blank" class="github_url">on GitHub</a>
546
626
 
547
627
  </p>
548
- <div id="M000162_source" class="dyn-source">
549
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 358</span>
628
+ <div id="M000093_source" class="dyn-source">
629
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 404</span>
550
630
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span> <span class="ruby-identifier">path</span>
551
631
  <span class="ruby-identifier">path_fid</span> = <span class="ruby-identifier">walk</span>(<span class="ruby-identifier">path</span>)
552
632
  <span class="ruby-identifier">remove_fid</span> <span class="ruby-identifier">path_fid</span> <span class="ruby-comment cmt"># remove also does clunk</span>
@@ -557,9 +637,9 @@ Deletes the file at the given path.
557
637
  </div>
558
638
 
559
639
  <div class="method">
560
- <div class="title" id="M000163">
640
+ <div class="title" id="M000096">
561
641
 
562
- <a name="M000163"></a><b>remove_fid</b>(path_fid)
642
+ <a name="M000096"></a><b>remove_fid</b>(path_fid)
563
643
 
564
644
  </div>
565
645
 
@@ -575,13 +655,13 @@ Deletes the file corresponding to the given FID and clunks the given FID.
575
655
 
576
656
  <div class="sourcecode">
577
657
  <p class="source-link">
578
- Source: <a href="javascript:toggleSource('M000163_source')" id="l_M000163_source">show</a>
658
+ Source: <a href="javascript:toggleSource('M000096_source')" id="l_M000096_source">show</a>
579
659
 
580
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L367" target="_blank" class="github_url">on GitHub</a>
660
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L413" target="_blank" class="github_url">on GitHub</a>
581
661
 
582
662
  </p>
583
- <div id="M000163_source" class="dyn-source">
584
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 367</span>
663
+ <div id="M000096_source" class="dyn-source">
664
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 413</span>
585
665
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_fid</span> <span class="ruby-identifier">path_fid</span>
586
666
  <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tremove</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_fid</span>)
587
667
  <span class="ruby-keyword kw">end</span></pre>
@@ -591,9 +671,49 @@ Deletes the file corresponding to the given FID and clunks the given FID.
591
671
  </div>
592
672
 
593
673
  <div class="method">
594
- <div class="title" id="M000167">
674
+ <div class="title" id="M000054">
675
+
676
+ <a name="M000054"></a><b>send</b>(request)
677
+
678
+ </div>
679
+
680
+ <div class="description">
681
+ <p>
682
+ Sends the given request (<a href="Fcall.html">Rumai::IXP::Fcall</a>) and
683
+ returns a ticket that you can use later to receive the reply.
684
+ </p>
685
+
686
+ </div>
687
+
688
+
689
+
690
+
691
+ <div class="sourcecode">
692
+ <p class="source-link">
693
+ Source: <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show</a>
694
+
695
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L111" target="_blank" class="github_url">on GitHub</a>
696
+
697
+ </p>
698
+ <div id="M000054_source" class="dyn-source">
699
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 111</span>
700
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send</span> <span class="ruby-identifier">request</span>
701
+ <span class="ruby-identifier">tag</span> = <span class="ruby-ivar">@tag_pool</span>.<span class="ruby-identifier">obtain</span>
702
+
703
+ <span class="ruby-identifier">request</span>.<span class="ruby-identifier">tag</span> = <span class="ruby-identifier">tag</span>
704
+ <span class="ruby-ivar">@stream</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">to_9p</span>
705
+
706
+ <span class="ruby-identifier">tag</span>
707
+ <span class="ruby-keyword kw">end</span></pre>
708
+ </div>
709
+ </div>
710
+
711
+ </div>
712
+
713
+ <div class="method">
714
+ <div class="title" id="M000097">
595
715
 
596
- <a name="M000167"></a><b>stat</b>(path)
716
+ <a name="M000097"></a><b>stat</b>(path)
597
717
 
598
718
  </div>
599
719
 
@@ -609,13 +729,13 @@ Returns information about the file at the given path.
609
729
 
610
730
  <div class="sourcecode">
611
731
  <p class="source-link">
612
- Source: <a href="javascript:toggleSource('M000167_source')" id="l_M000167_source">show</a>
732
+ Source: <a href="javascript:toggleSource('M000097_source')" id="l_M000097_source">show</a>
613
733
 
614
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L374" target="_blank" class="github_url">on GitHub</a>
734
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L420" target="_blank" class="github_url">on GitHub</a>
615
735
 
616
736
  </p>
617
- <div id="M000167_source" class="dyn-source">
618
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 374</span>
737
+ <div id="M000097_source" class="dyn-source">
738
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 420</span>
619
739
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stat</span> <span class="ruby-identifier">path</span>
620
740
  <span class="ruby-identifier">with_fid</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path_fid</span><span class="ruby-operator">|</span>
621
741
  <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">path_fid</span>, <span class="ruby-identifier">path</span>
@@ -628,9 +748,9 @@ Returns information about the file at the given path.
628
748
  </div>
629
749
 
630
750
  <div class="method">
631
- <div class="title" id="M000168">
751
+ <div class="title" id="M000098">
632
752
 
633
- <a name="M000168"></a><b>stat_fid</b>(path_fid)
753
+ <a name="M000098"></a><b>stat_fid</b>(path_fid)
634
754
 
635
755
  </div>
636
756
 
@@ -646,13 +766,13 @@ Returns information about the file referenced by the given FID.
646
766
 
647
767
  <div class="sourcecode">
648
768
  <p class="source-link">
649
- Source: <a href="javascript:toggleSource('M000168_source')" id="l_M000168_source">show</a>
769
+ Source: <a href="javascript:toggleSource('M000098_source')" id="l_M000098_source">show</a>
650
770
 
651
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L384" target="_blank" class="github_url">on GitHub</a>
771
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L430" target="_blank" class="github_url">on GitHub</a>
652
772
 
653
773
  </p>
654
- <div id="M000168_source" class="dyn-source">
655
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 384</span>
774
+ <div id="M000098_source" class="dyn-source">
775
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 430</span>
656
776
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stat_fid</span> <span class="ruby-identifier">path_fid</span>
657
777
  <span class="ruby-identifier">req</span> = <span class="ruby-constant">Tstat</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_fid</span>)
658
778
  <span class="ruby-identifier">rsp</span> = <span class="ruby-identifier">talk</span>(<span class="ruby-identifier">req</span>)
@@ -664,20 +784,16 @@ Returns information about the file referenced by the given FID.
664
784
  </div>
665
785
 
666
786
  <div class="method">
667
- <div class="title" id="M000099">
787
+ <div class="title" id="M000057">
668
788
 
669
- <a name="M000099"></a><b>talk</b>(request)
789
+ <a name="M000057"></a><b>talk</b>(request)
670
790
 
671
791
  </div>
672
792
 
673
793
  <div class="description">
674
794
  <p>
675
- Sends the given message (<a href="Fcall.html">Rumai::IXP::Fcall</a>) and
676
- returns its response.
677
- </p>
678
- <p>
679
- This method allows you to perform a 9P2000 transaction without worrying
680
- about the details of tag collisions and thread safety.
795
+ Sends the given request (<a href="Fcall.html">Rumai::IXP::Fcall</a>) and
796
+ returns its reply.
681
797
  </p>
682
798
 
683
799
  </div>
@@ -687,32 +803,21 @@ about the details of tag collisions and thread safety.
687
803
 
688
804
  <div class="sourcecode">
689
805
  <p class="source-link">
690
- Source: <a href="javascript:toggleSource('M000099_source')" id="l_M000099_source">show</a>
806
+ Source: <a href="javascript:toggleSource('M000057_source')" id="l_M000057_source">show</a>
691
807
 
692
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L110" target="_blank" class="github_url">on GitHub</a>
808
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L163" target="_blank" class="github_url">on GitHub</a>
693
809
 
694
810
  </p>
695
- <div id="M000099_source" class="dyn-source">
696
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 110</span>
811
+ <div id="M000057_source" class="dyn-source">
812
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 163</span>
697
813
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">talk</span> <span class="ruby-identifier">request</span>
698
- <span class="ruby-comment cmt"># send the request</span>
699
- <span class="ruby-identifier">tag</span> = <span class="ruby-ivar">@tag_pool</span>.<span class="ruby-identifier">obtain</span>
700
- <span class="ruby-identifier">bay</span> = <span class="ruby-ivar">@recv_bays</span>[<span class="ruby-identifier">tag</span>]
701
-
702
- <span class="ruby-identifier">request</span>.<span class="ruby-identifier">tag</span> = <span class="ruby-identifier">tag</span>
703
- <span class="ruby-identifier">output</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">to_9p</span>
704
- <span class="ruby-ivar">@send_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
705
- <span class="ruby-ivar">@stream</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">output</span>
706
- <span class="ruby-keyword kw">end</span>
707
-
708
- <span class="ruby-comment cmt"># receive the response</span>
709
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">bay</span>.<span class="ruby-identifier">shift</span>
710
- <span class="ruby-ivar">@tag_pool</span>.<span class="ruby-identifier">release</span> <span class="ruby-identifier">tag</span>
814
+ <span class="ruby-identifier">tag</span> = <span class="ruby-identifier">send</span>(<span class="ruby-identifier">request</span>)
711
815
 
712
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Rerror</span>
713
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;#{response.ename.inspect} in response to #{request.inspect}&quot;</span>
714
- <span class="ruby-keyword kw">else</span>
715
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
816
+ <span class="ruby-keyword kw">begin</span>
817
+ <span class="ruby-identifier">recv</span> <span class="ruby-identifier">tag</span>
818
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
819
+ <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; -- in reply to #{request.inspect}&quot;</span>
820
+ <span class="ruby-identifier">raise</span>
716
821
  <span class="ruby-keyword kw">end</span>
717
822
  <span class="ruby-keyword kw">end</span></pre>
718
823
  </div>
@@ -721,9 +826,9 @@ about the details of tag collisions and thread safety.
721
826
  </div>
722
827
 
723
828
  <div class="method">
724
- <div class="title" id="M000169">
829
+ <div class="title" id="M000101">
725
830
 
726
- <a name="M000169"></a><b>walk</b>(path)
831
+ <a name="M000101"></a><b>walk</b>(path)
727
832
 
728
833
  </div>
729
834
 
@@ -739,13 +844,13 @@ Returns an FID corresponding to the given path.
739
844
 
740
845
  <div class="sourcecode">
741
846
  <p class="source-link">
742
- Source: <a href="javascript:toggleSource('M000169_source')" id="l_M000169_source">show</a>
847
+ Source: <a href="javascript:toggleSource('M000101_source')" id="l_M000101_source">show</a>
743
848
 
744
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L393" target="_blank" class="github_url">on GitHub</a>
849
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L439" target="_blank" class="github_url">on GitHub</a>
745
850
 
746
851
  </p>
747
- <div id="M000169_source" class="dyn-source">
748
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 393</span>
852
+ <div id="M000101_source" class="dyn-source">
853
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 439</span>
749
854
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">walk</span> <span class="ruby-identifier">path</span>
750
855
  <span class="ruby-identifier">fid</span> = <span class="ruby-ivar">@fid_pool</span>.<span class="ruby-identifier">obtain</span>
751
856
  <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">fid</span>, <span class="ruby-identifier">path</span>
@@ -757,9 +862,9 @@ Returns an FID corresponding to the given path.
757
862
  </div>
758
863
 
759
864
  <div class="method">
760
- <div class="title" id="M000170">
865
+ <div class="title" id="M000102">
761
866
 
762
- <a name="M000170"></a><b>walk_fid</b>(path_fid, path)
867
+ <a name="M000102"></a><b>walk_fid</b>(path_fid, path)
763
868
 
764
869
  </div>
765
870
 
@@ -775,13 +880,13 @@ Associates the given FID to the given path.
775
880
 
776
881
  <div class="sourcecode">
777
882
  <p class="source-link">
778
- Source: <a href="javascript:toggleSource('M000170_source')" id="l_M000170_source">show</a>
883
+ Source: <a href="javascript:toggleSource('M000102_source')" id="l_M000102_source">show</a>
779
884
 
780
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L402" target="_blank" class="github_url">on GitHub</a>
885
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L448" target="_blank" class="github_url">on GitHub</a>
781
886
 
782
887
  </p>
783
- <div id="M000170_source" class="dyn-source">
784
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 402</span>
888
+ <div id="M000102_source" class="dyn-source">
889
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 448</span>
785
890
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">path_fid</span>, <span class="ruby-identifier">path</span>
786
891
  <span class="ruby-identifier">talk</span> <span class="ruby-constant">Twalk</span>.<span class="ruby-identifier">new</span>(
787
892
  <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@root_fid</span>,
@@ -795,15 +900,15 @@ Associates the given FID to the given path.
795
900
  </div>
796
901
 
797
902
  <div class="method">
798
- <div class="title" id="M000159">
903
+ <div class="title" id="M000085">
799
904
 
800
- <a name="M000159"></a><b>write</b>(path, content)
905
+ <a name="M000085"></a><b>write</b>(path, content)
801
906
 
802
907
  </div>
803
908
 
804
909
  <div class="description">
805
910
  <p>
806
- Returns the content of the file/directory at the given path.
911
+ Writes the given content to the file at the given path.
807
912
  </p>
808
913
 
809
914
  </div>
@@ -813,13 +918,13 @@ Returns the content of the file/directory at the given path.
813
918
 
814
919
  <div class="sourcecode">
815
920
  <p class="source-link">
816
- Source: <a href="javascript:toggleSource('M000159_source')" id="l_M000159_source">show</a>
921
+ Source: <a href="javascript:toggleSource('M000085_source')" id="l_M000085_source">show</a>
817
922
 
818
- | <a href="http://github.com/sunaku/rumai/blob/002c49633477b80743577bdc6d2f4f8c9a1bdd46/lib/rumai/ixp/transport.rb#L326" target="_blank" class="github_url">on GitHub</a>
923
+ | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L372" target="_blank" class="github_url">on GitHub</a>
819
924
 
820
925
  </p>
821
- <div id="M000159_source" class="dyn-source">
822
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 326</span>
926
+ <div id="M000085_source" class="dyn-source">
927
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 372</span>
823
928
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">content</span>
824
929
  <span class="ruby-identifier">open</span> <span class="ruby-identifier">path</span>, <span class="ruby-value str">'w'</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
825
930
  <span class="ruby-identifier">f</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">content</span>