co-timeout

0.1.0 • Public • Published

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)

Readme

Keywords

none

Package Sidebar

Install

npm i co-timeout

Weekly Downloads

7

Version

0.1.0

License

none

Last publish

Collaborators

  • yields