Quantcast
Channel: VMware Communities : Discussion List - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 2039

Are API calls multithreaded?

$
0
0

I have a page (see attached image) that I have that displays VMs.

 

I do a loop through the list and simutaneously request VM data for all the VMs in the list but vCD appears to process them sequentially which makes a screen update take 25 seconds for 9 VMs.

 

Here is my ajax routine:

 

 

        $( "#loop_btn" ).click( function () {
           $('.itemrow').each(function(index, itemrow) {
             $.get("/ajax/vm_get.php", { vmhref: itemrow.id }, function(vmdata) {
                   $(itemrow).data('vmdata', vmdata);
                   console.log(vmdata);
             }, "json");
           console.log("OK");
           });
        });

 

 

and it calls a php script that gets the data and converts it to json:

 

...


// Login

$auth = array('username'=>$_SESSION['cloud']['username'], 'password'=>$_SESSION['cloud']['password']);

$service = VMware_VCloud_SDK_Service::getService();

$service->login($server, $auth, $httpConfig);


$sdkVm = $service->createSDKObj($href);

$vm = $sdkVm->getVm();

echo json_encode(simplexml_load_string($vm->export()));

exit;
Dion

Viewing all articles
Browse latest Browse all 2039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>