Comparing version 0.1.2 to 0.1.3
@@ -13,7 +13,10 @@ /* Copyright 2015, Wang Wenlin */ | ||
var r1 = yield db.query('SELECT 1', chan); | ||
var r2 = yield request('http://www.google.com', chan); | ||
db.query('SELECT 1', chan); | ||
var r1 = yield chan; | ||
db1.query('SELECT 1 FROM dummy', then(ch2, function (res) { ch2(null, res[0]); })); | ||
db2.query('SELECT 3', chan); | ||
request('http://www.google.com', chan); | ||
var r2 = yield; | ||
db.query('SELECT 1 FROM dummy', then(ch2, function (res) { ch2(null, res[0]); })); | ||
db.query('SELECT 3', chan); | ||
var r3 = yield ch2; | ||
@@ -23,4 +26,4 @@ var r4 = yield; | ||
go(function* (ch3) { | ||
db1.query('SELECT 1', bind(ch3, 'r5')); | ||
db2.query('SELECT 3', bind(ch3, 'r6')); | ||
db.query('SELECT 1', bind(ch3, 'r5')); | ||
db.query('SELECT 3', bind(ch3, 'r6')); | ||
var rx = yield; | ||
@@ -27,0 +30,0 @@ var ry = yield; |
15
index.js
@@ -14,7 +14,10 @@ /* Copyright 2015, Wang Wenlin */ | ||
// | ||
// var r1 = yield db.query('SELECT 1', chan); | ||
// var r2 = yield request('http://www.google.com', chan); | ||
// db.query('SELECT 1', chan); | ||
// var r1 = yield chan; | ||
// | ||
// db1.query('SELECT 1 FROM dummy', then(ch2, function (res) { ch2(null, res[0]); })); | ||
// db2.query('SELECT 3', chan); | ||
// request('http://www.google.com', chan); | ||
// var r2 = yield; | ||
// | ||
// db.query('SELECT 1 FROM dummy', then(ch2, function (res) { ch2(null, res[0]); })); | ||
// db.query('SELECT 3', chan); | ||
// var r3 = yield ch2; | ||
@@ -24,4 +27,4 @@ // var r4 = yield; | ||
// go(function* (ch3) { | ||
// db1.query('SELECT 1', bind(ch3, 'r5')); | ||
// db2.query('SELECT 3', bind(ch3, 'r6')); | ||
// db.query('SELECT 1', bind(ch3, 'r5')); | ||
// db.query('SELECT 3', bind(ch3, 'r6')); | ||
// var rx = yield; | ||
@@ -28,0 +31,0 @@ // var ry = yield; |
{ | ||
"name": "gojs", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "go.js, Golang like channels and go.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,7 +15,10 @@ go.js, Golang like channels and go. | ||
var r1 = yield db.query('SELECT 1', chan); | ||
var r2 = yield request('http://www.google.com', chan); | ||
db.query('SELECT 1', chan); | ||
var r1 = yield chan; | ||
db1.query('SELECT 1 FROM dummy', then(ch2, function (res) { ch2(null, res[0]); })); | ||
db2.query('SELECT 3', chan); | ||
request('http://www.google.com', chan); | ||
var r2 = yield; | ||
db.query('SELECT 1 FROM dummy', then(ch2, function (res) { ch2(null, res[0]); })); | ||
db.query('SELECT 3', chan); | ||
var r3 = yield ch2; | ||
@@ -25,4 +28,4 @@ var r4 = yield; | ||
go(function* (ch3) { | ||
db1.query('SELECT 1', bind(ch3, 'r5')); | ||
db2.query('SELECT 3', bind(ch3, 'r6')); | ||
db.query('SELECT 1', bind(ch3, 'r5')); | ||
db.query('SELECT 3', bind(ch3, 'r6')); | ||
var rx = yield; | ||
@@ -29,0 +32,0 @@ var ry = yield; |
@@ -101,3 +101,3 @@ /* Copyright 2015, Wang Wenlin */ | ||
it('yield specific chan would make runloop to read from it', function (done) { | ||
it('yield specific chan would make runloop to read from that', function (done) { | ||
go(function* (chan) { | ||
@@ -104,0 +104,0 @@ var ch2 = Channel(); |
10746
310
44