Comparing version 0.4.0 to 0.4.1
@@ -12,8 +12,5 @@ /* Copyright 2015, Wang Wenlin */ | ||
go(function* (ch) { | ||
db.query('SELECT 1', ch); | ||
var rows = yield ch; | ||
var r1 = yield db.query('SELECT 1', ch); | ||
var r2 = yield db.query('SELECT 2', ch); | ||
request('http://www.google.com', ch); | ||
var [resp, body] = yield; | ||
redis.hget('k1', ch); | ||
@@ -24,2 +21,5 @@ redis.get('k2', ch); | ||
request('http://www.google.com', ch); | ||
var [resp, body] = yield ch; | ||
go(function* (ch2) { | ||
@@ -26,0 +26,0 @@ db.query('SELECT 1', bind(ch2, 'r3')); |
10
index.js
@@ -24,7 +24,2 @@ /* Copyright 2015, Wang Wenlin */ | ||
chan.ctor_ = Channel; | ||
chan.read = function () { return q_.shift(); } | ||
chan.wait = wait; | ||
return chan; | ||
function chan(arg) { | ||
@@ -37,2 +32,7 @@ var l = arguments.length; | ||
chan.ctor_ = Channel; | ||
chan.read = function () { return q_.shift(); } | ||
chan.wait = wait; | ||
return chan; | ||
function write(msg) { | ||
@@ -39,0 +39,0 @@ q_.push(msg); |
{ | ||
"name": "gojs", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "go.js, Golang like channels, goroutine and go.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,8 +13,5 @@ go.js, Golang like channels, goroutine and go. | ||
go(function* (ch) { | ||
db.query('SELECT 1', ch); | ||
var rows = yield ch; | ||
var r1 = yield db.query('SELECT 1', ch); | ||
var r2 = yield db.query('SELECT 2', ch); | ||
request('http://www.google.com', ch); | ||
var [resp, body] = yield; | ||
redis.hget('k1', ch); | ||
@@ -25,2 +22,5 @@ redis.get('k2', ch); | ||
request('http://www.google.com', ch); | ||
var [resp, body] = yield ch; | ||
go(function* (ch2) { | ||
@@ -27,0 +27,0 @@ db.query('SELECT 1', bind(ch2, 'r3')); |
13253