Alvis-Pipeline

 view release on metacpan or  search on metacpan

bin/alvis-zsink.pl  view on Meta::CPAN

while (my $xml = $pipe->read(1)) {
    eval {
	$conn->connect($zhost);
    }; if ($@ && ref $@ && $@->isa("ZOOM::Exception") &&
	   $@->diagset() eq "Bib-1" && $@->code() == 224) {
	# Do nothing: this allows for a bug in ZOOM-C (as of YAZ
	# version 2.1.27) whereby a no-opping call to connect() does
	# not clear any old error indication.
	print "ignoring re-occurrence of old error in connect()\n";
    } elsif ($@) {
	die $@; # re-throw
    }

    if (!$connected) {
	print "connected to Z39.50 server\n";
	$connected = 1;
    }
    print "got document ", ++$n, " ... ";

    eval {
	my $p = $conn->package();

lib/Alvis/Pipeline.pm  view on Meta::CPAN


=head2 read()

 # Read-pipes only
 $xml = $in->read($block);

Reads an XML document from the specified inbound pipe, and returns it
as a string.  If there is no document ready to read, it
either returns an undefined value (if no argment is provided, or if
the argument is false) or blocks if the argument is provided and true.
C<read()> throws an exception if an error occurs.

Once a document has been read in this way, it will no longer be
available for subsequent C<read()>s, so a sequence of C<read()> calls
will read all the available records one at a time.

Once a document has been read, it is the responsibility of the reader
to process it and pass it on to the next component in the pipeline.
If something catastrophic happens, and the record is lost, then an
out-of-band mechanism may be used to request a new copy of the record
from the writer.  The C<Alvis::Pipeline> module does not directly



( run in 0.383 second using v1.01-cache-2.11-cpan-496ff517765 )