"Now you hit an API that has to do some async behaviour and now your screwed. There are some solutions for that but they make the code really complex, even Node.js."
What does that even mean?
"Now you hit an API that has to do some async behaviour and now your screwed. There are some solutions for that but they make the code really complex, even Node.js."
What does that even mean?
The protocol I wrote just sent a job-ID to the client and the client started polling for the result.
Since AJAX is already asynchronous I could write a JavaScript library for the browser, which made the whole thing transparent for the client.
The only problem I ran into were multiple long running jobs, which caused parallel polling. But since the communication between server and client was hidden behind the client-lib, I could change the protocol later, to merge multiple polling requests in one etc.
[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10...
→ POST /resource
← 202 Accepted
← Location: /jobs/XXX