@@ -157,7 +157,7 @@ concurrently:
157
157
158
158
~~~~
159
159
use task::spawn;
160
- use pipes ::{stream, Port, Chan};
160
+ use comm ::{stream, Port, Chan};
161
161
162
162
let (port, chan): (Port<int>, Chan<int>) = stream();
163
163
@@ -178,7 +178,7 @@ stream for sending and receiving integers (the left-hand side of the `let`,
178
178
a tuple into its component parts).
179
179
180
180
~~~~
181
- # use pipes ::{stream, Chan, Port};
181
+ # use comm ::{stream, Chan, Port};
182
182
let (port, chan): (Port<int>, Chan<int>) = stream();
183
183
~~~~
184
184
@@ -189,7 +189,7 @@ spawns the child task.
189
189
~~~~
190
190
# use task::{spawn};
191
191
# use task::spawn;
192
- # use pipes ::{stream, Port, Chan};
192
+ # use comm ::{stream, Port, Chan};
193
193
# fn some_expensive_computation() -> int { 42 }
194
194
# let (port, chan) = stream();
195
195
do spawn || {
@@ -209,7 +209,7 @@ computation, then waits for the child's result to arrive on the
209
209
port:
210
210
211
211
~~~~
212
- # use pipes ::{stream, Port, Chan};
212
+ # use comm ::{stream, Port, Chan};
213
213
# fn some_other_expensive_computation() {}
214
214
# let (port, chan) = stream::<int>();
215
215
# chan.send(0);
@@ -225,7 +225,7 @@ following program is ill-typed:
225
225
226
226
~~~ {.xfail-test}
227
227
# use task::{spawn};
228
- # use pipes ::{stream, Port, Chan};
228
+ # use comm ::{stream, Port, Chan};
229
229
# fn some_expensive_computation() -> int { 42 }
230
230
let (port, chan) = stream();
231
231
@@ -245,7 +245,7 @@ Instead we can use a `SharedChan`, a type that allows a single
245
245
246
246
~~~
247
247
# use task::spawn;
248
- use pipes ::{stream, SharedChan};
248
+ use comm ::{stream, SharedChan};
249
249
250
250
let (port, chan) = stream();
251
251
let chan = SharedChan(chan);
@@ -278,7 +278,7 @@ might look like the example below.
278
278
279
279
~~~
280
280
# use task::spawn;
281
- # use pipes ::{stream, Port, Chan};
281
+ # use comm ::{stream, Port, Chan};
282
282
283
283
// Create a vector of ports, one for each child task
284
284
let ports = do vec::from_fn(3) |init_val| {
@@ -393,7 +393,7 @@ internally, with additional logic to wait for the child task to finish
393
393
before returning. Hence:
394
394
395
395
~~~
396
- # use pipes ::{stream, Chan, Port};
396
+ # use comm ::{stream, Chan, Port};
397
397
# use task::{spawn, try};
398
398
# fn sleep_forever() { loop { task::yield() } }
399
399
# do task::try {
@@ -468,7 +468,7 @@ Here is the function that implements the child task:
468
468
469
469
~~~~
470
470
# use std::comm::DuplexStream;
471
- # use pipes ::{Port, Chan};
471
+ # use comm ::{Port, Chan};
472
472
fn stringifier(channel: &DuplexStream<~str, uint>) {
473
473
let mut value: uint;
474
474
loop {
@@ -491,7 +491,7 @@ Here is the code for the parent task:
491
491
492
492
~~~~
493
493
# use std::comm::DuplexStream;
494
- # use pipes ::{Port, Chan};
494
+ # use comm ::{Port, Chan};
495
495
# use task::spawn;
496
496
# fn stringifier(channel: &DuplexStream<~str, uint>) {
497
497
# let mut value: uint;
0 commit comments