Skip to content

Commit dab6a85

Browse files
committed
core: Extract comm from pipes. #4742
1 parent ab784b7 commit dab6a85

File tree

89 files changed

+683
-611
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+683
-611
lines changed

doc/tutorial-tasks.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ concurrently:
157157

158158
~~~~
159159
use task::spawn;
160-
use pipes::{stream, Port, Chan};
160+
use comm::{stream, Port, Chan};
161161
162162
let (port, chan): (Port<int>, Chan<int>) = stream();
163163
@@ -178,7 +178,7 @@ stream for sending and receiving integers (the left-hand side of the `let`,
178178
a tuple into its component parts).
179179

180180
~~~~
181-
# use pipes::{stream, Chan, Port};
181+
# use comm::{stream, Chan, Port};
182182
let (port, chan): (Port<int>, Chan<int>) = stream();
183183
~~~~
184184

@@ -189,7 +189,7 @@ spawns the child task.
189189
~~~~
190190
# use task::{spawn};
191191
# use task::spawn;
192-
# use pipes::{stream, Port, Chan};
192+
# use comm::{stream, Port, Chan};
193193
# fn some_expensive_computation() -> int { 42 }
194194
# let (port, chan) = stream();
195195
do spawn || {
@@ -209,7 +209,7 @@ computation, then waits for the child's result to arrive on the
209209
port:
210210

211211
~~~~
212-
# use pipes::{stream, Port, Chan};
212+
# use comm::{stream, Port, Chan};
213213
# fn some_other_expensive_computation() {}
214214
# let (port, chan) = stream::<int>();
215215
# chan.send(0);
@@ -225,7 +225,7 @@ following program is ill-typed:
225225

226226
~~~ {.xfail-test}
227227
# use task::{spawn};
228-
# use pipes::{stream, Port, Chan};
228+
# use comm::{stream, Port, Chan};
229229
# fn some_expensive_computation() -> int { 42 }
230230
let (port, chan) = stream();
231231
@@ -245,7 +245,7 @@ Instead we can use a `SharedChan`, a type that allows a single
245245

246246
~~~
247247
# use task::spawn;
248-
use pipes::{stream, SharedChan};
248+
use comm::{stream, SharedChan};
249249
250250
let (port, chan) = stream();
251251
let chan = SharedChan(chan);
@@ -278,7 +278,7 @@ might look like the example below.
278278

279279
~~~
280280
# use task::spawn;
281-
# use pipes::{stream, Port, Chan};
281+
# use comm::{stream, Port, Chan};
282282
283283
// Create a vector of ports, one for each child task
284284
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
393393
before returning. Hence:
394394

395395
~~~
396-
# use pipes::{stream, Chan, Port};
396+
# use comm::{stream, Chan, Port};
397397
# use task::{spawn, try};
398398
# fn sleep_forever() { loop { task::yield() } }
399399
# do task::try {
@@ -468,7 +468,7 @@ Here is the function that implements the child task:
468468

469469
~~~~
470470
# use std::comm::DuplexStream;
471-
# use pipes::{Port, Chan};
471+
# use comm::{Port, Chan};
472472
fn stringifier(channel: &DuplexStream<~str, uint>) {
473473
let mut value: uint;
474474
loop {
@@ -491,7 +491,7 @@ Here is the code for the parent task:
491491

492492
~~~~
493493
# use std::comm::DuplexStream;
494-
# use pipes::{Port, Chan};
494+
# use comm::{Port, Chan};
495495
# use task::spawn;
496496
# fn stringifier(channel: &DuplexStream<~str, uint>) {
497497
# let mut value: uint;

src/compiletest/procsrv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn run(lib_path: ~str,
7676

7777

7878
writeclose(pipe_in.out, input);
79-
let p = pipes::PortSet();
79+
let p = comm::PortSet();
8080
let ch = p.chan();
8181
do task::spawn_sched(task::SingleThreaded) || {
8282
let errput = readclose(pipe_err.in);

0 commit comments

Comments
 (0)