1 # $Id: Pod.pm,v 1.2 2006-05-09 12:03:37 mike Exp $
12 $conn1 = new ZOOM::Connection("bagel.indexdata.com/gils");
13 $conn2 = new ZOOM::Connection("z3950.loc.gov:7090/Voyager");
14 $pod = new ZOOM::Pod($conn1, $conn2);
15 $pod->callback(ZOOM::Event::RECV_SEARCH, \&show_result);
16 $pod->search_pqf("mineral");
20 ($conn, $rs, $event) = @_;
21 print "$conn: found ", $rs->size(), " records\n";
30 foreach my $conn (@conn) {
32 $conn = new ZOOM::Connection($conn, 0, async => 1);
45 my($event, $sub) = @_;
47 my $old = $this->{callback}->{$event};
48 $this->{callback}->{$event} = $sub
58 foreach my $i (0..@{ $this->{conn} }-1) {
59 $this->{rs}->[$i] = $this->{conn}->[$i]->search_pqf($pqf);
67 while ((my $i = ZOOM::event($this->{conn})) != 0) {
68 my $conn = $this->{conn}->[$i-1];
69 my $ev = $conn->last_event();
70 print("connection ", $i-1, ": ", ZOOM::event_str($ev), "\n");
71 my $sub = $this->{callback}->{$ev};
73 $res = &$sub($conn, $this->{rs}->[$i-1], $ev);