php - Use asynchronous long polling? -
i have zend–based application uses long polling. makes http post request, blocks application until either returns or times out after 20 seconds.
i have need make second request (which non-parallel), unfortunately if first request hangs, ends being 20 seconds (= timeout) before second request executes.
what best way make application asynchronous, or @ least non-blocking http request i/o?
mmmh, maybe should add more information questions. if 2 requests aren't related (i.e. second 1 doesn't need first 1 finished) can perform several queries without waiting first 1 finish. of course cannot without javascript.
for example use jquery ajax function in asynchronous mode (by default it's asynchronous). can chain several ajax calls in jquery second 1 not wait first 1 finished (but careful ajax timeout settings).
Comments
Post a Comment