by daGrevis · 12y ago · 0 comments
[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10...
→ POST /resource
← 202 Accepted
← Location: /jobs/XXXThe 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.