X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTask%2FRetrieve.pm;h=1580e94fba15d195269b48a2550072c39f3a1ee6;hp=e0ed1f436cc5abda730ef3048ee30ff2dcfc370f;hb=e61887a109576fa0e066547c0ce033631a290f8f;hpb=2fe5adf17a223393e231b757b953b0e1923d3d0e diff --git a/lib/ZOOM/IRSpy/Task/Retrieve.pm b/lib/ZOOM/IRSpy/Task/Retrieve.pm index e0ed1f4..1580e94 100644 --- a/lib/ZOOM/IRSpy/Task/Retrieve.pm +++ b/lib/ZOOM/IRSpy/Task/Retrieve.pm @@ -1,4 +1,3 @@ -# $Id: Retrieve.pm,v 1.2 2006-10-25 17:16:14 mike Exp $ package ZOOM::IRSpy::Task::Retrieve; @@ -31,6 +30,9 @@ sub new { 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; } @@ -40,18 +42,22 @@ sub run { $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->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->{options}->{preferredRecordSyntax}; + my $syntax = $this->{syntax}; $syntax = defined $syntax ? "'$syntax'" : "undef"; return ref($this) . "(" . $this->{index0} . ", $syntax)"; }