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; } }
-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"
In reply to Re^2: You cannot pass args when calling inner() in Moose?
by metaperl
in thread You cannot pass args when calling inner() in Moose?
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |