NAME
Stepford::Role::Step - The basic role all step classes must implement
VERSION
version 0.000002
DESCRIPTION
All of your step classes must consume this role. It provides the basic interface that the Stepford::Scheduler class expects
ATTRIBUTES
This role provides one attribute:
name
This attribute is required for all roles. It must be a string.
dependencies
This attribute should be an array of one or more strings, each of which is the name of another step. This attribute is optional.
METHODS
This role provides the following methods:
$step->name()
Returns the step's name.
$step->dependencies()
Returns a list (not an arrayref) of the dependencies passed to the constructor.
$step->_has_dependencies
Returns true if the step has dependencies.
$step->is_up_to_date_since($timestamp)
Given a timestamp as a Unix epoch, this method should return true or false to indicate whether the step is up to date versus the timestamp.
Note that this timestamp could be a floating point number, and you are encouraged to use Time::HiRes as appropriate to provide hi-res timestamps of your own.
REQUIRED METHODS
All classes which consume the Stepford::Role::Step role must implement the following methods:
$step->run()
This method receives no arguments. It is expected to do whatever it is that the step does.
It may also do other things such as record the last run time.
In the future, this method may receive additional arguments, such as a logger object.
$step->last_run_time()
This method must return a timestamp marking the last time the step was run. You are encouraged to use Time::HiRes as appropriate to provide hi-res timestamps.
AUTHOR
Dave Rolsky <drolsky@maxmind.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by MaxMind, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.