ZOOM::IRSpy::Task::Retrieve - a searching task for IRSpy


ZOOM-IRSpy documentation Contained in the ZOOM-IRSpy distribution.

Index


Code Index:

NAME

Top

ZOOM::IRSpy::Task::Retrieve - a searching task for IRSpy

SYNOPSIS

Top

 ## to follow

DESCRIPTION

Top

 ## to follow

SEE ALSO

Top

ZOOM::IRSpy

AUTHOR

Top

Mike Taylor, <mike@indexdata.com>

COPYRIGHT AND LICENSE

Top


ZOOM-IRSpy documentation Contained in the ZOOM-IRSpy distribution.
package ZOOM::IRSpy::Task::Retrieve;

use 5.008;
use strict;
use warnings;

use ZOOM::IRSpy::Task;
our @ISA = qw(ZOOM::IRSpy::Task);

sub new {
    my $class = shift();
    my($rs) = shift();
    my($index0) = shift();

    my $this = $class->SUPER::new(@_);
    $this->{rs} = $rs;
    $this->{index0} = $index0;
    # Save initial record-syntax for render()'s benefit
    $this->{syntax} = $this->{options}->{preferredRecordSyntax};

    return $this;
}

sub run {
    my $this = shift();

    $this->set_options();

    my $conn = $this->conn();
    $conn->connect($conn->option("host"));

    my $rs = $this->{rs};
    my $index0 = $this->{index0};
    $this->irspy()->log("irspy_task", $conn->option("host"),
			" retrieving record $index0 from $rs, rs='",
			$rs->option("preferredRecordSyntax"), "'");
    $rs->records($index0, 1, 0); # requests record
    warn "no ZOOM-C level events queued by $this"
	if $conn->is_idle();

    $this->set_options();
}

sub render {
    my $this = shift();
    my $syntax = $this->{syntax};
    $syntax = defined $syntax ? "'$syntax'" : "undef";
    return ref($this) . "(" . $this->{index0} . ", $syntax)";
}

use overload '""' => \&render;


1;