env-js
                                
                                 env-js copied to clipboard
                                
                                    env-js copied to clipboard
                            
                            
                            
                        create a real async XHR
Implement XHR using async i/o, either through EM or through ruby threads.
I like it ! :)
What I did to solve that problem is a javascript XHR mocker. I define some urls which are mocked and no xhr request is made. Then I can get exactly the content I want and test it in my application.
The project is here : http://github.com/dmathieu/moqueur
Cool.
Note that XHR works fine, in a limited sort of way. It's just that it's always sync, not async. Making it async is a challenge. Combing Ruby threads with SpiderMonkey is nye on to impossible.