Closed
Description
extern mod std;
use core::pipes::*;
use std::comm::DuplexStream;
use core::task;
fn main () {
let (chan, port): (Chan<int>, Port<int>) = stream();
do task::spawn() |move port| {
assert port.recv() == 123;
assert !port.peek();
}
chan.send(123);
}
There is no message available but peek returns true, likely because this: https://github.com/mozilla/rust/blob/incoming/src/libcore/pipes.rs#L516
I expect that anytime peek
returns true I can call recv
successfully.