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; | |
import std::task; | |
tag request { | |
quit; | |
close(int, chan[bool]); | |
} | |
type ctx = chan[request]; |
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; | |
fn producer(chan[u8[]] c) { | |
c <| ~[1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8, 8u8, 9u8, 10u8, 11u8, 12u8, 13u8 ]; | |
} | |
fn main() { | |
let port[u8[]] p = port(); | |
let task prod = spawn producer(chan(p)); |
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; | |
import std::ivec; | |
tag msg { | |
closed; | |
received(u8[]); | |
} | |
fn producer(chan[u8[]] c) { | |
c <| ~[1u8, 2u8, 3u8, 4u8]; |
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
native "rust" mod rustrt { | |
fn task_yield(); | |
} | |
fn main() { | |
spawn rustrt::task_yield(); | |
} |
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
SyntaxError: Unexpected token ILLEGAL | |
at Object.parse (native) | |
at IncomingMessage.<anonymous> (/usr/home/dev/tree-bot/builds.js:89:23) | |
at IncomingMessage.emit (events.js:81:20) | |
at HTTPParser.onMessageComplete (http.js:133:23) | |
at Socket.ondata (http.js:1213:22) | |
at Socket._onReadable (net.js:681:27) | |
at IOWatcher.onReadable [as callback] (net.js:177:10) |