Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

aws-sdk doesn't load from inside a node.js domain #75

Closed
vthunder opened this Issue · 3 comments

2 participants

@vthunder

While debugging issue #74, I tried to use the new (experimental) domains feature. Setting up a domain for the request works, but I also tried putting my entire server (including all the require()s--except require('domain') itself, of course) in a domain. That causes this error:

Error: addListener only takes instances of Function
at Request.EventEmitter.addListener (events.js:140:11)
at Object.AWS.EventEmitter.AWS.util.inherit.addListeners (/Users/dmills/Documents/Code/openhome/node_modules/aws-sdk/lib/event_emitter.js:63:14)
/lib/client.js:47:10)

Let me know if you want the full stack trace, I don't want to puke all over the bug report.

@lsegal
Owner

The full stack trace would actually be more useful. Are you calling something explicit on the request object? Requests should no longer extend from node's EventEmitter, as we are moving to more of a state machine based approach that can support asynchronous event transitions (something EventEmitter does not support).

Unfortunately this means that we currently do not support domains in the AWS.Request object. If you think it's useful to have this support, it's something we can look into adding, but without a stable domains API, it might not happen right away. Fortunately Node.js v0.10.0 bumped the API from experimental to unstable, so it looks like things are moving in the right direction for us to have a locked down API-- one that we would happily support.

@lsegal lsegal closed this in 501a678
@lsegal
Owner

@vthunder thanks for the report. This latest change should add (basic) support for the new (now unstable) domain API in Node. This API might change in the future, so our support may break-- it also may not yet be complete. Test it out and let us know how it works for you.

@vthunder

Thanks! Apologies - I didn't pay attention to my Github notifications for a couple of months.

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.