mardi 31 mai 2016

multi request in wordpress ajax plugin at the same time

why wordpress not allow to run multi request at the same time in admin-ajax.php ? when I send these two action iwannawait and idontwannawait to "admin-ajax.php" at the same time , previous request must be complete (in this , code wait for 60s) and next request will start .. I tried multi url query for passing browser waiting requests (admin-ajax.php?req1 .. admin-ajax.php?req2 but is still not work

add_action('wp_ajax_iwannawait', 'iwannawait');
add_action('wp_ajax_idontwannawait', 'idontwannawait');

function iwannawait()
{
sleep(60); 
echo "60!";
die();      
}

function idontwannawait()
{
echo "0!";
die();      
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire