DrupalSite multiple service calls

Events happening in the community are now at Drupal community events on www.drupal.org.
amcc's picture

Using DrupalSite to connect to services it seems you can only make one service call at a time.

I've made a new service called taxonomy.getTerm in the taxonomy_service.module - this uses taxonomy_get_term() to return a term. I have a need to load multiple terms for each node - so each node that i'm getting in flash uses this service i've made to get all the term data. Unfortunately the BLOCKING method in DrupalSite prevents you running multiple simultaneous service calls.

Is there a good reason for this, if not what's a good work around?

Comments

A clunky workaround

amcc's picture

If you call the DrupalSite service method directly the blocking bit is ignored, so in my above example I did it this way:

<?php
var args = new Array(my_argument, my_callback_function);
drupalSite.service(success, fail, "taxonomy.getTerm", args);

//drupalsite is my DrupalSite object reference
//success and fail are 2 methods i needed to create in the class i'm calling this from (as they're private methods in DrupalSite - though i suppose they could be made public)
?>

It would seem more logical to have a property that prevented the blocking method from being used for quick and dirty service calls like the one i'm making - so lots of calls can be fired off at once

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: