Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

co.any() support? #93

Closed
fengmk2 opened this Issue · 2 comments

3 participants

@fengmk2

I want to request a url with timeout logic, code examples:

try {
  // return the first finished result
  var r = yield any(get('http://google.com'), timeout('1000ms'));
} catch (e) {
  console.log(e); // timeout or http request error
}

https://github.com/visionmedia/co/tree/master/examples only have parallel example.

@jonathanong
Collaborator

i have https://github.com/cojs/assert-timeout for that, but doesn't belong in co

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.