Documentation ¶
Index ¶
- Variables
- type Awaken
- type Context
- type Desc
- type ExecConfig
- type ExecResult
- type ExecSummery
- type Execution
- func (er *Execution) CanRetry() bool
- func (er *Execution) End(result ExecResult, t time.Time)
- func (er *Execution) Ended() bool
- func (er *Execution) Executing() bool
- func (er *Execution) OverExecTime(t time.Time) bool
- func (er *Execution) ReadyToStart() bool
- func (er *Execution) Start(t time.Time)
- func (er *Execution) WaitingStart() bool
- type Executor
- type FuncExecutor
- type Info
- type Manager
- type MemoScheduler
- func (scheduler *MemoScheduler) Close(ctx context.Context) error
- func (scheduler *MemoScheduler) CloseTaskSchedule(ctx context.Context, task Task) error
- func (scheduler *MemoScheduler) NewStageID(ctx context.Context, taskKey string) (seq int64, err error)
- func (scheduler *MemoScheduler) ReadTask(ctx context.Context, taskKey string) (*Task, error)
- func (scheduler *MemoScheduler) ScheduleTask(ctx context.Context, task Task, overlap bool) (Task, error)
- func (scheduler *MemoScheduler) TaskSummery(ctx context.Context) (*Summery, error)
- func (scheduler *MemoScheduler) WaitTaskAwaken(ctx context.Context) (awaken Awaken, err error)
- type Profile
- type Schedule
- type Scheduler
- type StatusCode
- type StatusProfile
- type Summery
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExecuting = errors.New("is executing")
View Source
var ErrOverMaxRetry = errors.New("over max retry")
Functions ¶
This section is empty.
Types ¶
type ExecConfig ¶ added in v0.2.0
type ExecResult ¶
type ExecResult struct { ResultInfo string `bson:"resultInfo"` ResultCode int64 `bson:"resultCode"` NextExec ExecConfig `bson:"next,omitempty"` }
type ExecSummery ¶ added in v0.2.0
type Execution ¶
type Execution struct { Available bool Config ExecConfig `bson:"config"` CreateTime time.Time `bson:"createTime,omitempty"` StartTime time.Time `bson:"startTime,omitempty"` EndTime time.Time `bson:"endTime,omitempty"` Result ExecResult `bson:"result,omitempty"` }
func (*Execution) OverExecTime ¶ added in v0.1.5
func (*Execution) ReadyToStart ¶
func (*Execution) WaitingStart ¶
type FuncExecutor ¶
func (FuncExecutor) StartExecution ¶
func (fe FuncExecutor) StartExecution(cb Context) error
type Info ¶ added in v0.1.5
type Info struct { Tags []string `bson:"tags"` ExecConfig ExecConfig `bson:"execDesc"` CreateTime time.Time `bson:"createTime"` ExecCount int32 `bson:"execCount"` }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ApplyNewTask ¶
func (*Manager) TaskCallback ¶
type MemoScheduler ¶
type MemoScheduler struct {
// contains filtered or unexported fields
}
func NewMemoScheduler ¶
func NewMemoScheduler(awakenDuration time.Duration) *MemoScheduler
func (*MemoScheduler) Close ¶ added in v0.3.0
func (scheduler *MemoScheduler) Close(ctx context.Context) error
func (*MemoScheduler) CloseTaskSchedule ¶ added in v0.1.5
func (scheduler *MemoScheduler) CloseTaskSchedule(ctx context.Context, task Task) error
func (*MemoScheduler) NewStageID ¶ added in v0.3.0
func (*MemoScheduler) ScheduleTask ¶ added in v0.1.5
func (*MemoScheduler) TaskSummery ¶ added in v0.1.5
func (scheduler *MemoScheduler) TaskSummery(ctx context.Context) (*Summery, error)
func (*MemoScheduler) WaitTaskAwaken ¶
func (scheduler *MemoScheduler) WaitTaskAwaken(ctx context.Context) (awaken Awaken, err error)
type Profile ¶
type Profile struct { TaskKey string Status StatusCode Executions []Execution }
type Scheduler ¶
type Scheduler interface { ScheduleTask(ctx context.Context, task Task, overlap bool) (Task, error) CloseTaskSchedule(ctx context.Context, task Task) error WaitTaskAwaken(ctx context.Context) (awaken Awaken, err error) ReadTask(ctx context.Context, taskKey string) (*Task, error) NewStageID(ctx context.Context, taskKey string) (stageID int64, err error) Close(ctx context.Context) error }
type StatusCode ¶ added in v0.1.5
type StatusCode int
func (StatusCode) String ¶ added in v0.1.5
func (status StatusCode) String() string
type StatusProfile ¶
type Summery ¶
type Summery struct {
StatusCount map[StatusCode]int64
}
Click to show internal directories.
Click to hide internal directories.