added request.setTimeout support#80
added request.setTimeout support#80brandonrobertz wants to merge 3 commits intobrowserify:masterfrom brandonrobertz:master
Conversation
lib/request.js
Outdated
There was a problem hiding this comment.
Could be:
this.xhr.ontimeout = this.emit.bind(this, 'timeout')Depends on whether you prefer anonymous closures though.
There was a problem hiding this comment.
I pretty much ported directly from the node implementation, but used the xhr-provided timeout scaffolding. The this.once('timeout', callback) just adds a one-time event handler. It shouldn't call back immediately.
I'm gonna be doing a little more testing with your binding/emit code. It's a lot cleaner.
There was a problem hiding this comment.
Right, sorry. My mistake. LGTM otherwise :)
|
I've tested fa18e1f with my target libs. Looking good. |
|
Could you add a basic test for this?
|
|
Yeah, I'll work on something. It's complicated, because so much of this depends on |
|
I wrote two tests. One to make sure |
|
If nobody objects or has comments ... @substack ? |
|
@substack any comments on this? thx |
|
Would it be possible to get this merged? |
|
I believe someone willing to do it would have to ask @substack on twitter for repository and maintainer rights on this project. If he feels like he will have the bandwidth and will to do so. |
|
I spoke with substack on IRC a while back about this and it turns out browserify is now using |
Yes if you are using the latest browserify. Some people may not but not sure we need to fix this :) Then the next step would be to deprecate this module officially in the README, close issues and PRs. |
This is a port of node's request http
setTimeoutmethod.