Documentation ¶
Index ¶
Constants ¶
const ( WAITING = "waiting" RUNNING = "running" )
Variables ¶
This section is empty.
Functions ¶
func AreTaskDagsEqual ¶
func AreTaskDagsEqual(taskDag1, taskDag2 task.TaskRunner) bool
AreTaskDagsEqual ... Figures out if DAGS are equal by performing breadth first search on each dag, sorting the slice of tasks by depth then hash, then comparing the slices for equality.
func GetTaskSchedulerLogFilePath ¶
GetTaskSchedulerLogFilePath ... Gven a TaskScheduler name returns log file path based on settings
func ReCreateStoredDag ¶
func ReCreateStoredDag(RootDAG task.TaskRunner, schedulerUUID string) error
ReCreateStoredDag ... re creates previously scheduled task dag. all tasks in a task dag runn share a scheduler uuid which is the expected
Types ¶
type PlanktonRecord ¶
type PlanktonRecord struct { gorm.Model TaskName string TaskParams string TaskHash string ParentHash string ChildHashes string SchedulerUUID string SchedulerName string ExecutionTime float64 Priority int StartedAt time.Time EndedAt time.Time Version string }
PlanktonRecord ... The gorm model used to save meta data for each run, enabled by passing
type TaskRunnerDepth ¶
type TaskRunnerDepth struct {
// contains filtered or unexported fields
}
type TaskScheduler ¶
type TaskScheduler struct { Name string RootRunner task.TaskRunner Logger *log.Logger CronSpec string // contains filtered or unexported fields }
TaskScheduler ... The object responsible for taking the root node of a task DAG and running it via the Start() method.
func NewTaskScheduler ¶
func NewTaskScheduler(schedulerName, cronSpec string, RootRunner task.TaskRunner, recordRun bool) (*TaskScheduler, error)
NewTaskScheduler ... Returns new task scheduler
func (*TaskScheduler) LastRecords ¶
func (ts *TaskScheduler) LastRecords() []Result
LastRecords ...
Returns list of all plankton meta data results
func (*TaskScheduler) LastRun ¶
func (ts *TaskScheduler) LastRun() string
LastRun ... Returns date string of latest run
func (*TaskScheduler) SetStatus ¶
func (ts *TaskScheduler) SetStatus(newStatus string) error
SetStatus ... Used to set TaskScheduler.status in a thread safe way
func (*TaskScheduler) Start ¶
func (ts *TaskScheduler) Start()
Start ...
Entry point for starting the DAG beginning at the RootRunner. Each call to Start() does a number of things:
- create new UUID for the scheduler
- starts all TaskRunners, taking into account concurrency limit
- records output if recordRun is set to true
func (*TaskScheduler) Status ¶
func (ts *TaskScheduler) Status() string
Status ... Used to expose TaskScheduler.status in a thread safe way