MultiProcFactory::Generic - product class returned by factory class MultiProcFactory. Generic class that forks off children defined in partition_list.


This Class is an implementation of the interface for the parent factory object whew. That might not have made too much sense because perl doesnt really enforce interfaces. But the interface should basically have 3 methods sub init(), sub do_child_init(), and sub work(). These methods are required as defined by me. Basically init() is called from base class contructor it sets up your process binning logic at the highest level. It checks all input parameters and bins items in partition_list into partition_hash. After initial parent setup in init() do_child_init() is called this method allows you to do child setup initialization. Finally the work() function is called this method at a minimum must call sub do_child(). This method is the main action method. In it you define what you want to do at the process level. In the most basic case you just call do_child() but if youd like to use do_child() as an iterator you might loop over a result set and execute do_child in a loop.


sub init() class initialization

Bins partition elements into self->{partition_hash}.

sub do_child_init()

This method does any basic child process level initialization. In this implentation it does nothing.

sub work()

This method at the bare minimum must call do_child(). In the case of this class thats exactly what it does. Sub classes of this class can expand on this method to iterate do_child over a result set. do_child is a required subroutine reference passed in to parent factory method.


  • partition_list - partition_list => [$url1, $url2, $url3]

    * In this generic class this defines the elements to be forked. Each key relates to one process.


Aaron Dancygier, <>


Copyright 2004 by Aaron Dancygier

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


perl(1), MultiProcFactory