No, because the superclass method does things before and after the loop. The only thing that the GUI aspect does is update a progress bar during a loop. I settled on simply having an if-then within
updateprogress
sub updateprogress {
my ($self) = @_;
return unless $self->progressbar;
my @frac = ($self->recordi, $self->recordcount);
my $frac = frac(@frac);
$self->progressbar->set_fraction($frac->num);
$self->progressbar->set_text( sprintf '%d / %d', @frac);
use Gtk2;
while (Gtk2->events_pending) {
Gtk2->main_iteration;
}
Gtk2::Gdk->flush;
}
sub manager {
my ($Operation) = @_;
my @row = $Operation->getnew;
$Operation->log->debug( 'getnew rows:' . scalar(@row) );
$Operation->recordi(0);
for my $row (@row) {
$Operation->recordi( $Operation->recordi + 1 );
$Operation->log->debug( ' --- data --- ' . Dumper($row) );
$Operation->data($row);
$Operation->process;
$Operation->updateprogress;
}
}