[Yazlist] yaz_wait with events in php

Kardos András k.andris at gmail.com
Fri Dec 12 20:45:44 CET 2008


Hi,

I'm trying to use YAZ-PHP with multiple servers in assync "event"
mode. Can someone provide me with a working example of using it? I
start searching on 5 servers, call yaz_wait repeatedly, which returns
one resource at a time, but about 10 times per server. How do I find
out what thees event actually means? At which event can I call other
functions to get the results of searches. If I don't use this "event"
mode, I only get the results, when all servers answered, wich is a
waste of time.

Thanks,
Andris

my .php source:

  foreach($multi as $m)
    yaz_search($m['z'], 'rpn', $rpn);

  $options = array('event' => true);

  $i = 0;
  do {

    $z = yaz_wait($options);

    $c = $multi[$z];
    echo $i, ': ', $c['name'], yaz_error($z), "\n";
    //var_dump(yaz_hits($z));
    flush();

    $i++;

  } while ($i < 100 and $z !== false);



More information about the Yazlist mailing list