Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: You cannot pass args when calling inner() in Moose?

by metaperl (Curate)
on Jul 22, 2011 at 16:39 UTC ( [id://916160]=note: print w/replies, xml ) Need Help??


in reply to Re: You cannot pass args when calling inner() in Moose?
in thread You cannot pass args when calling inner() in Moose?

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; } }




The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.

-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://916160]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2024-04-19 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found