I've got a series of web services implemented as models that a controller
might call as such:

$a = $this->WebService1->findByName($searchstring1);
$b = $this->WebService2->findByName($searchstring2)
$c = $this->WebService3->findByName($searchstring3)
// Do something with $a, $b, and $c, then pass it to the view

Each model implements some form of caching, but in the event of a cache-miss
the user has to wait for all 3 web services to execute concurrently.

I'd like to use curl_multi_exec to make the calls go in parallel, but the
curl object isn't exposed to the world, and the blocking model doesn't work
anymore.  Is there anything prettier than

$curl_a = $this->WebService1->setupFindByName($searchstring1);
$curl_b = $this->WebService2->setupFindByName($searchstring2)
$curl_c = $this->WebService3->setupFindByName($searchstring3)

// curl_multi_add_handle ...
// do { curl_multi_exec... } while $(waiting)

$a = $this->WebService1->findByName(curl_multi_getcontent($curl_a));
$b = $this->WebService1->findByName(curl_multi_getcontent($curl_b));
$c = $this->WebService1->findByName(curl_multi_getcontent($curl_b));

Would this be wrapped in another model? Or is there another form more
appropriate for this?

Thanks

Sean

-- 
Sean Walberg <[EMAIL PROTECTED]>    http://ertw.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to