Created
November 5, 2012 00:10
-
-
Save brson/4014490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::comm::DuplexStream; | |
enum PingPong { Ping, Pong }; | |
fn main() { | |
let (channel1, channel2): (DuplexStream<PingPong, PingPong>, DuplexStream<PingPong, PingPong>) = DuplexStream(); | |
spawn |move channel1| { | |
channel.send(Ping), | |
loop { | |
match channel.recv() { | |
} | |
spawn |move channel2| { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment