For the time-being, I have if-then'ed a solution:
sub updateprogress {
my ($self) = @_;
return unless $self->progressbar;
my $frac = frac($self->recordi, $self->recordcount);
$self->progressbar->set_fraction($frac->num);
}
and then the data processing loop blindly calls this graphic method:
sub manager {
my ($Operation) = @_;
my @row = $Operation->getnew;
my ( @warnings, @fatals );
$Operation->recordi(0);
for my $row (@row) {
$Operation->recordi( $Operation->recordi + 1 );
$Operation->data($row);
$Operation->process;
$Operation->updateprogress;
}
( \@warnings, @fatals );
}