Schedule::LongSteps::Process - A base class for all LongSteps processes.
Returns the current state (a HashRef JSONable data structure) of this process.
Returns a new step from the given properties.
Usage examples:
# In a process class. sub do_current_step{ my ($self) = @_; return $this->new_step({ run_at => DateTime->... , what => 'do_nextstep' , state => { new => 'state' } }); }
If you omit run_at, the process will not run again and stay in paused state until you go and set the run_at time manually.
If you omit 'what', the next step to run will be the same as the current step.
If you omit 'state', the state just doesnt change.
Returns a final step that will never run from the given properies.
Usage:
# In a Process class. sub do_last_thing{ my ($self) = @_; return $self->final_step({ state => { the => 'final' , state => 1 } }); }
If you omit 'state', the current state of the process just doesnt change and the process terminates with the current state.
Wait for the given process IDs and returns whatever the given closure returns.
return $this->wait_process( [ $pid1 , $pid2 ], sub{ ... return $this->new_step(...); # or whatever usual stuff }
If you skip the closure, this will just terminate $this process after the given subprocesses have finished.
Returns an array-ref of revive methods associated with the process.
To install Schedule::LongSteps, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Schedule::LongSteps
CPAN shell
perl -MCPAN -e shell install Schedule::LongSteps
For more information on module installation, please visit the detailed CPAN module installation guide.