Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elem ¶
type Elem struct { TimeoutCh <-chan struct{} Cancel context.CancelFunc Timeout time.Duration ErrCh chan error DoneCh chan interface{} ExitCh chan struct{} }
type TaskOp ¶
type TaskOp interface { Op() Op TaskRun() *TaskRun // Processing represents what the `op` really do, you shouldn't update task inside `processing`. // you should put update logic in `WhenXXX`. Processing() (interface{}, error) // WhenDone will be invoked if task op is done. WhenDone(data interface{}) error // WhenLogicError will be invoked if task occurred an error when do logic. WhenLogicError(err error) error // WhenTimeout will be invoked if task is timeout. WhenTimeout() error // WhenCancel will be invoked if task is canceled. WhenCancel() error TimeoutConfig() (<-chan struct{}, context.CancelFunc, time.Duration) // TuneTriggers return corresponding triggers at concrete tune point. TuneTriggers() TaskOpTuneTriggers }
type TaskOpTuneTriggers ¶
type TaskOpTuneTriggers struct { BeforeProcessing aoptypes.TuneTrigger AfterProcessing aoptypes.TuneTrigger }
type TaskRun ¶
type TaskRun struct { Task *spec.PipelineTask Ctx context.Context Executor types.ActionExecutor P *spec.Pipeline ClusterInfo clusterinfo.Interface EdgeRegister edgepipeline_register.Interface Bdl *bundle.Bundle DBClient *dbclient.Client QuitQueueTimeout bool QuitWaitTimeout bool StopQueueLoop bool StopWaitLoop bool ExecutorDoneCh chan spec.ExecutorDoneChanData // 轮训状态间隔期间可能任务已经是终态,FakeTimeout = true FakeTimeout bool // svc ActionAgentSvc actionagent.Interface ActionMgr actionmgr.Interface RetryInterval time.Duration }
TaskRun represents task runtime.
func New ¶
func New(ctx context.Context, task *spec.PipelineTask, executor types.ActionExecutor, p *spec.Pipeline, bdl *bundle.Bundle, dbClient *dbclient.Client, actionAgentSvc actionagent.Interface, actionMgr actionmgr.Interface, clusterInfo clusterinfo.Interface, edgeRegister edgepipeline_register.Interface, retryInterval time.Duration, ) *TaskRun
New returns a TaskRun. TODO refactored into task reconciler.
func (*TaskRun) AppendLastMsg ¶
func (*TaskRun) LogStep ¶
reconciler: pipelineID: 1, taskID: 1, taskName: repo, taskOp: start, step: begin do WhenDone
func (*TaskRun) UpdateTaskInspect ¶
UpdateTaskInspect update task inspect, and get events from inspect
func (*TaskRun) WhenCancel ¶
Click to show internal directories.
Click to hide internal directories.