Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

rhesa's scratchpad

by rhesa (Vicar)
on Oct 11, 2005 at 12:59 UTC ( #499146=scratchpad: print w/replies, xml ) Need Help??

PoCo::JobQueue skeleton

use POE qw( Session Component::JobQueue ); ### The queue processing session POE::Session->create( inline_states => { _start => \&start_queue, acquire_jobs => \&acquire_jobs, enqueue_job => \&enqueue_job, finish_job => \&finish_job, } ); ### The actual queue POE::Component::JobQueue->spawn( Alias => 'MyQueue', WorkerLimit => 4, Worker => sub { my ( $postback, $job ) = @_; my @results = process_job( $job ); $postback->(@results); }, Passive => {}, ); # Main event loop POE::Kernel->run(); # session states sub start_queue { $_[KERNEL]->yield('acquire_jobs'); } sub acquire_jobs { # implement some way to receive jobs. # here i'm going to pretend i can poll some resource # and loop indefinitely if( my $job = poll_resource() ) { $_[KERNEL]->yield( enqueue_job => $job ); } # poll again in 10 seconds $_[KERNEL]->delay_add( acquire_jobs => 10 ); } sub enqueue_job { my ($job) = @_[ ARG0 ]; # this will enqueue the job on the job queue $_[KERNEL]->post( MyQueue => 'enqueue', 'finish_job', # our event on completion $job ); } sub finish_job { my ( $request_packet, $response_packet ) = @_[ ARG0, ARG1 ]; my ($job) = @{$request_packet}; # original post/fetch my @job_results = @{$response_packet}; # passed from the postba +ck # do cleanup } ### example our $p = 0; sub poll_resource { ++$p } sub process_job { my $job = shift; print "I got job $job\n" } __END__

Programming hurdles

  • assignment and sequence seem trivial, but trip up many;
  • choice is not much of an additional hurdle;
  • iteration / recursion is hard, and is the cliff at which the remaining failures pause;
  • concurrency is reached by only a tiny percentage of programmers in their lifetime.
From "The elephant in the room", Richard Bornat and Saeed Dehnadi, School of Computing Science, Middlesex University (presentation slides" (in PDF))

CPAN shell - list of issues/quirks/gripes

Someone asked me to keep a list of things that might be improved about the cpan shell. So I'm keeping that here.
  • Documentation
  • Context sensitive help. I'd love to do "help o conf" and be told how it works; esp. since the documentation is so scant on this
  • Command line parsing: switching between ppm and cpan made me type "cpan install Foo" a lot, but "install" pulls in ponie plus a whole cart of manure
  • How does o conf work with lists? Every time I have to tweak the mirror list, I get lost or screw up the list.
  • It would be nice if the build process would halt at the first sign of trouble. Having to wade through pages of output to find the culprit is difficult, or even impossible.
  • Dependency handling + build/test failures
  • pure M::B dist support
Log In?

What's my password?
Create A New User
[stevieb]: shmem thanks for the 'insight' :P
[shmem]: good thing that Sun already took "OpenWindows", otherwise I'd not stop to shudder imagining an "OpenWindows" from MS
[shmem]: more garbage in, more garbage out that would be
[stevieb]: I found that win10 broke a C# library I was using for one project while enhancing tests for a Perl dist, which breaks other Perl dists, and I'm about to throw my hands up on berrybrew. win2k12 broke one thing, win10 breaks something...
[stevieb]: ...unrelated which requires replacing a lot of code and a whole lib. I'm about to go nix only ffs
[shmem]: stevieb: what you're doing sounds afwully complex. Too much for me this evening to provide brighter insight ;-)
[stevieb]: I don't even own a Windows computer. Both my girl and I have a laptop each with Linux. I'm supporting Windows in some of my projects and I can't even guage whether it's worth it or not.
[stevieb]: shmem It's something I desired to have years ago, which is why I took over berrybrew. Cross-platform build/test automation locally, or over the network Test::BrewBuild
[shmem]: sounds good.
[shmem]: but I'm crumbling smaller stones. remember...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-03-28 22:04 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (342 votes). Check out past polls.