0.1.0 • Published 10 years ago

co-timeout v0.1.0

Weekly downloads
21
License
-
Repository
-
Last release
10 years ago

co-timeout

Error on timeout.

function *install(ms){
  yield timeout(ms, function*(){
    yield pkg.resolve('org/project');
    yield pkg.fetch('org/project');
    yield pkg.extract('org/project', '/path/to/org-project');
  });
}

try {
  yield install('100ms');
} catch (e) {
  console.log('retry');
  yield install('500ms');
}

API

timeout(ms, thunk|gen)

Timeout with an error after ms.

License

(MIT)

0.1.0

10 years ago

0.0.1

10 years ago