Documentation ¶
Index ¶
Constants ¶
View Source
const (
// SchedulerCallback ...
SchedulerCallback = "EXECUTION_SWEEP_CALLBACK"
)
Variables ¶
View Source
var ( // Ctl is a global task controller instance Ctl = NewController() )
View Source
var ( // ExecutionCtl is a global execution controller. ExecutionCtl = NewExecutionController() )
View Source
var ( // SweepCtl is the global sweep controller SweepCtl = NewSweepController() )
Functions ¶
func ScheduleSweepJob ¶
ScheduleSweepJob schedules the system execution sweep job.
Types ¶
type Controller ¶
type Controller interface { // Stop the specified task. Stop(ctx context.Context, id int64) (err error) // Get the specified task. Get(ctx context.Context, id int64) (task *task.Task, err error) // List the tasks according to the query. List(ctx context.Context, query *q.Query) (tasks []*task.Task, err error) // Get the log of the specified task. GetLog(ctx context.Context, id int64) (log []byte, err error) // Count counts total. Count(ctx context.Context, query *q.Query) (int64, error) }
Controller manages the task
func NewController ¶
func NewController() Controller
NewController creates an instance of the default task controller.
type ExecutionController ¶
type ExecutionController interface { // Stop all linked tasks of the specified execution. Stop(ctx context.Context, id int64) (err error) // Delete the specified execution and its tasks. Delete(ctx context.Context, id int64) (err error) // Get the specified execution. Get(ctx context.Context, id int64) (execution *task.Execution, err error) // List executions according to the query. List(ctx context.Context, query *q.Query) (executions []*task.Execution, err error) // Count counts total. Count(ctx context.Context, query *q.Query) (int64, error) }
ExecutionController manages the execution.
func NewExecutionController ¶
func NewExecutionController() ExecutionController
NewExecutionController creates an instance of the default execution controller.
type SweepController ¶
type SweepController interface {
Start(ctx context.Context, params *SweepParams, trigger string) error
}
func NewSweepController ¶
func NewSweepController() SweepController
type SweepParams ¶
Click to show internal directories.
Click to hide internal directories.