postrank-labs/goliath — Issue #99: Example: Async HTTP Requests not waiting for response callback
Author: brookemckim
Created: 2011-10-23 20:26:31+00:00
State: open

https://gist.github.com/1307841

```
[11658:INFO] 2011-10-23 16:22:05 :: Starting server on 0.0.0.0:9000 in development mode. Watch out for stones.
[11658:DEBUG] 2011-10-23 16:22:07 :: Non-callback status : 0
[11658:INFO] 2011-10-23 16:22:07 :: Status: 0, Content-Length: 0, Response Time: 44.93ms
[11658:DEBUG] 2011-10-23 16:22:07 :: Callback status : 200
```

Goliath is responding before the EM:HttpRequest is finished so it is returning an empty response. From what I understand I shouldn't have to use the callbacks and when trying to put the response array inside the callback I get an error. I am using ruby 1.9.3-dev because of the issues between EM-Synchrony and the latest 1.9.2 patchlevel.

Gems and server code are available in the gist.