Thuzi/facebook-node-sdk — pull request #5 by nmcquay (2012-05-24 08:31:00+00:00)
Title: Adding timeout options

I need to make millions of api calls per day, and needed to throttle the amount of open calls I had at any one time. When I have an api call that takes longer than 60 seconds to respond I know it has timed out, and needs to be retried. So I added the setMaxWait option. This sets the timeout option on the request.

Then to make sure the code can see that a timeout happened, I send any error that had an error code back to the callback so I can correctly handle the timeout errors (or any other error code).

I didn't call the method "setTimeout" because it breaks the global setTimeout.