0.0.1 • Published 11 years ago
gocsp-timeout v0.0.1
gocsp-timeout
Timeout timer
Usage
var go = require('gocsp-go')
var select = require('gocsp-select')
var timeout = require('gocsp-timeout')
go(function* () {
yield timeout(1000) // sleep for a while
yield select(function (s) {
s(go(function* () {
// ...
yield timeout(50)
// ...
}), function () {
console.log('should reach here')
})
||
s(timeout(100), function () {
console.log('should not reach here')
})
})
})
License
MIT
0.0.1
11 years ago