Add warnings if running tasks leaves the ZOOM connections idle. (Doesn't currently...
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Task / Connect.pm
1 # $Id: Connect.pm,v 1.6 2006-11-02 16:11:44 mike Exp $
2
3 # See ZOOM/IRSpy/Task/Search.pm for documentation
4
5 package ZOOM::IRSpy::Task::Connect;
6
7 use 5.008;
8 use strict;
9 use warnings;
10
11 use ZOOM::IRSpy::Task;
12 our @ISA = qw(ZOOM::IRSpy::Task);
13
14 sub new {
15     my $class = shift();
16
17     return $class->SUPER::new(@_);
18 }
19
20 sub run {
21     my $this = shift();
22
23     $this->set_options();
24
25     my $conn = $this->conn();
26     $conn->log("irspy_task", "connecting");
27     $conn->connect($conn->option("host"));
28     warn "no ZOOM-C level events queued by $this"
29         if $conn->is_idle();
30
31     $this->set_options();
32 }
33
34 sub render {
35     my $this = shift();
36     return ref($this) . " " . $this->conn()->option("host");
37 }
38
39 use overload '""' => \&render;
40
41 1;