Skip to content

Commit df7af5e

Browse files
authored
Documentation fix (#59)
* Update docs after #54 * Fix typo.
1 parent 765203a commit df7af5e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

imports.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ following pseudo-code:</p>
231231
<pre><code class="language-text">let pollable = this.subscribe();
232232
while !contents.is_empty() {
233233
// Wait for the stream to become writable
234-
poll-one(pollable);
234+
pollable.block();
235235
let Ok(n) = this.check-write(); // eliding error handling
236236
let len = min(n, contents.len());
237237
let (chunk, rest) = contents.split_at(len);
@@ -240,7 +240,7 @@ while !contents.is_empty() {
240240
}
241241
this.flush();
242242
// Wait for completion of `flush`
243-
poll-one(pollable);
243+
pollable.block();
244244
// Check for any errors that arose during `flush`
245245
let _ = this.check-write(); // eliding error handling
246246
</code></pre>
@@ -300,7 +300,7 @@ all derived <a href="#pollable"><code>pollable</code></a>s created with this fun
300300
</ul>
301301
<h4><a name="method_output_stream.write_zeroes"><code>[method]output-stream.write-zeroes: func</code></a></h4>
302302
<p>Write zeroes to a stream.</p>
303-
<p>this should be used precisely like <code>write</code> with the exact same
303+
<p>This should be used precisely like <code>write</code> with the exact same
304304
preconditions (must use check-write first), but instead of
305305
passing a list of bytes, you simply pass the number of zero-bytes
306306
that should be written.</p>
@@ -323,15 +323,15 @@ the following pseudo-code:</p>
323323
<pre><code class="language-text">let pollable = this.subscribe();
324324
while num_zeroes != 0 {
325325
// Wait for the stream to become writable
326-
poll-one(pollable);
326+
pollable.block();
327327
let Ok(n) = this.check-write(); // eliding error handling
328328
let len = min(n, num_zeroes);
329329
this.write-zeroes(len); // eliding error handling
330330
num_zeroes -= len;
331331
}
332332
this.flush();
333333
// Wait for completion of `flush`
334-
poll-one(pollable);
334+
pollable.block();
335335
// Check for any errors that arose during `flush`
336336
let _ = this.check-write(); // eliding error handling
337337
</code></pre>

wit/poll.wit

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package wasi:io@0.2.0-rc-2023-11-10;
33
/// A poll API intended to let users wait for I/O events on multiple handles
44
/// at once.
55
interface poll {
6-
/// `pollable` epresents a single I/O event which may be ready, or not.
6+
/// `pollable` represents a single I/O event which may be ready, or not.
77
resource pollable {
88

99
/// Return the readiness of a pollable. This function never blocks.

wit/streams.wit

+5-5
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ interface streams {
131131
/// let pollable = this.subscribe();
132132
/// while !contents.is_empty() {
133133
/// // Wait for the stream to become writable
134-
/// poll-one(pollable);
134+
/// pollable.block();
135135
/// let Ok(n) = this.check-write(); // eliding error handling
136136
/// let len = min(n, contents.len());
137137
/// let (chunk, rest) = contents.split_at(len);
@@ -140,7 +140,7 @@ interface streams {
140140
/// }
141141
/// this.flush();
142142
/// // Wait for completion of `flush`
143-
/// poll-one(pollable);
143+
/// pollable.block();
144144
/// // Check for any errors that arose during `flush`
145145
/// let _ = this.check-write(); // eliding error handling
146146
/// ```
@@ -178,7 +178,7 @@ interface streams {
178178

179179
/// Write zeroes to a stream.
180180
///
181-
/// this should be used precisely like `write` with the exact same
181+
/// This should be used precisely like `write` with the exact same
182182
/// preconditions (must use check-write first), but instead of
183183
/// passing a list of bytes, you simply pass the number of zero-bytes
184184
/// that should be written.
@@ -199,15 +199,15 @@ interface streams {
199199
/// let pollable = this.subscribe();
200200
/// while num_zeroes != 0 {
201201
/// // Wait for the stream to become writable
202-
/// poll-one(pollable);
202+
/// pollable.block();
203203
/// let Ok(n) = this.check-write(); // eliding error handling
204204
/// let len = min(n, num_zeroes);
205205
/// this.write-zeroes(len); // eliding error handling
206206
/// num_zeroes -= len;
207207
/// }
208208
/// this.flush();
209209
/// // Wait for completion of `flush`
210-
/// poll-one(pollable);
210+
/// pollable.block();
211211
/// // Check for any errors that arose during `flush`
212212
/// let _ = this.check-write(); // eliding error handling
213213
/// ```

0 commit comments

Comments
 (0)