- my $tasks = $this->tasks();
- if (!defined $tasks) {
- $this->tasks([ $task ]);
- } else {
- $tasks->[-1]->{next} = $task;
- push @$tasks, $task;
- }
-
- $this->log("irspy", "added task $task");
-}
-
-
-sub start_task {
- my $this = shift();
- my($task) = @_;
- die "no task defined for " . $this->option("host")
- if !defined $task;
-
- $this->current_task($task);
- $task->run();
+ my $tasks = $this->{tasks};
+ $tasks->[-1]->{next} = $task if @$tasks > 0;
+ push @$tasks, $task;
+ $this->log("irspy_task", "added task $task");