Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> If I understand correctly you're saying that JavaScript is a neutral language. It's only a coincidence that in Browsers and in Node.js it heavily relies on the callback style. As a language itself, it could be synchronous.

I remember that I once wrote a JS library that loaded another page in an iframe and simply polled it to see if it had the data I wanted soon. These days, I probably would have written the server to respond with 202 Accept and then just timeout and poll again in X milliseconds. Block until it was ready, if need be.

It's not hard, and it's not even particularly frowned upon.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: