Documentation ¶
Index ¶
- func CancelGlobalTask(ctx context.Context, taskKey string) error
- func PauseTask(ctx context.Context, taskKey string) error
- func ResumeTask(ctx context.Context, taskKey string) error
- func RunWithRetry(ctx context.Context, maxRetry int, backoffer backoff.Backoffer, ...) error
- func SubmitAndRunGlobalTask(ctx context.Context, taskKey string, taskType proto.TaskType, concurrency int, ...) error
- func SubmitGlobalTask(ctx context.Context, taskKey string, taskType proto.TaskType, concurrency int, ...) (*proto.Task, error)
- func WaitGlobalTask(ctx context.Context, id int64) error
- func WaitTaskDoneByKey(ctx context.Context, taskKey string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelGlobalTask ¶
CancelGlobalTask cancels a global task.
func ResumeTask ¶
ResumeTask resumes a task.
func RunWithRetry ¶
func RunWithRetry( ctx context.Context, maxRetry int, backoffer backoff.Backoffer, logger *zap.Logger, f func(context.Context) (bool, error), ) error
RunWithRetry runs a function with retry, when retry exceed max retry time, it returns the last error met. if the function fails with err, it should return a bool to indicate whether the error is retryable. if context done, it will stop early and return ctx.Err().
func SubmitAndRunGlobalTask ¶
func SubmitAndRunGlobalTask(ctx context.Context, taskKey string, taskType proto.TaskType, concurrency int, taskMeta []byte) error
SubmitAndRunGlobalTask submits a global task and wait for it to finish.
func SubmitGlobalTask ¶
func SubmitGlobalTask(ctx context.Context, taskKey string, taskType proto.TaskType, concurrency int, taskMeta []byte) (*proto.Task, error)
SubmitGlobalTask submits a global task.
func WaitGlobalTask ¶
WaitGlobalTask waits for a global task done or paused. this API returns error if task failed or cancelled.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.