UNPKG

csp

Version:

Communicating sequential processes for node. Go style concurrency with channels.

10 lines (7 loc) 178 B
var csp = require(".."); var chan1 = new csp.Chan(); csp.spawn(function* () { console.log("will block"); yield chan1.put("channel"); console.log(yield chan1.take()); });