handle

package
v1.1.0-beta.0...-c0b86a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelGlobalTask

func CancelGlobalTask(ctx context.Context, taskKey string) error

CancelGlobalTask cancels a global task.

func PauseTask

func PauseTask(ctx context.Context, taskKey string) error

PauseTask pauses a task.

func ResumeTask

func ResumeTask(ctx context.Context, taskKey string) error

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

func WaitGlobalTask(ctx context.Context, id int64) error

WaitGlobalTask waits for a global task done or paused. this API returns error if task failed or cancelled.

func WaitTaskDoneByKey

func WaitTaskDoneByKey(ctx context.Context, taskKey string) error

WaitTaskDoneByKey waits for a global task done by task key.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL