Verby::Dispatcher

Verby::Dispatcher is a Perl module that takes steps and executes them.
Download

Verby::Dispatcher Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Yuval Kogman
  • Publisher web site:
  • http://search.cpan.org/~nobull/

Verby::Dispatcher Tags


Verby::Dispatcher Description

Verby::Dispatcher is a Perl module that takes steps and executes them. Verby::Dispatcher is a Perl module that takes steps and executes them. Sort of like what make is to a Makefile.SYNOPSIS use Verby::Dispatcher; use Verby::Config::Data; # or something equiv my $c = Verby::Config::Data->new(); # ... needs the "logger" field set my $d = Verby::Dispatcher->new; $d->config_hub($c); $d->add_steps(@steps); $d->do_all;METHODSnewReturns a new Verby::Dispatcher. Duh!add_steps *@steps add_step *@stepsAdd a number of steps into the dispatcher pool.Anything returned from "depends" in Verby::Step is aggregated recursively here, and added into the batch too.do_allCalculate all the dependencies using Algorithm::Dependency::Objects, and then dispatch in order.dep_engine_classThe class used to instantiate the dependecy resolver. Defaults to Algorithm::Dependency::Objects::Ordered. Subclass if you don't like it.config_hub ?$new_config_hubA setter getter for the Verby::Config::Data (or compatible) object from which we will derive the global context, and it's sub-contexts.global_contextReturns the global context for the dispatcher.If necessary derives a context from "config_hub".is_running $stepWhether or not $step is currently executing.is_satisfied $stepWhether or not $step does not need to be executed (because it was already executed or because it didn't need to be in the first place).get_cxt $stepReturns the context associated with $step. This is where $step will write it's data.get_derivable_cxts $stepReturns the contexts to derive from, when creating a context for $step.If $step starts a new context ("provides_cxt" in Step is true) then a new context is created here, derived from get_parent_cxts($step). Otherwise it simply returns get_parent_cxts($step).Note that when a step 'provides a context' this really means that a new context is created, and this context is derived for the step, and any step that depends on it.get_parent_cxts $stepIf $step depends on any other steps, take their contexts. Otherwise, returns the global context.start_step $stepIf step supports the async interface, start it and put it in the running step queue. If it's synchroneous, call it's "do" in Step method.finish_step $stepFinish step, and mark it as satisfied. Only makes sense for async steps.mark_running $stepPut $step in the running queue, and mark it in the running step set.push_running $stepPush $step into the running step queue.pop_runningPop a step from the running queue.mk_dep_engineCreates a new object using "dep_engine_class".ordered_stepsReturns the steps to be executed in order.pump_runningGive every running step a bit of time to move things forward.This method is akin to "pump" in IPC::Run.It also calls "finish_step" on each step that returns false.stepsReturns a list of steps that the dispatcher cares about.step_setReturns the Set::Object that is used for internal bookkeeping of the steps involved.running_stepsReturns a list of steps currently running.running_setReturns the Set::Object that is used to track which steps are running.satisfied_setReturns the Set::Object that is used to track which steps are satisfied.wait_allWait for all the running steps to finish.wait_oneEffectively finish_step(pop_running).wait_specific $stepWaits for a specific step to finish. Called by pump_running when a step claims that it's ready. Requirements: · Perl


Verby::Dispatcher Related Software