X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTask%2FRetrieve.pm;h=4d7a8c5b60eab3724f0f56cff634f6b4963b025b;hp=05833865077a792e6a3c5ea63983bc0039d61389;hb=cde7deb27fdf5b3c873f602ec6d72290cfc3df3f;hpb=6692dc648d9520a7256d56c7a04f8ddd21ea856f diff --git a/lib/ZOOM/IRSpy/Task/Retrieve.pm b/lib/ZOOM/IRSpy/Task/Retrieve.pm index 0583386..4d7a8c5 100644 --- a/lib/ZOOM/IRSpy/Task/Retrieve.pm +++ b/lib/ZOOM/IRSpy/Task/Retrieve.pm @@ -1,4 +1,4 @@ -# $Id: Retrieve.pm,v 1.1 2006-10-25 15:45:29 mike Exp $ +# $Id: Retrieve.pm,v 1.6 2007-05-09 11:05:30 mike Exp $ package ZOOM::IRSpy::Task::Retrieve; @@ -31,6 +31,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 +43,24 @@ 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(); - return ref($this) . "(" . $this->{rs}. ", " . $this->{index0} . ")"; + my $syntax = $this->{syntax}; + $syntax = defined $syntax ? "'$syntax'" : "undef"; + return ref($this) . "(" . $this->{index0} . ", $syntax)"; } use overload '""' => \&render;