Documentation
¶
Index ¶
- Variables
- func ChangeTaskGroup(ctx context.Context, taskID uint32, group string) error
- func CreateTask(ctx context.Context, user, group string, taskTyp uint32, taskCtx string, ...) (uint32, error)
- func DeleteTask(ctx context.Context, taskID uint32) error
- func GetTask(ctx context.Context, taskID uint32) (*async_task.Task, error)
- func GetTasks(ctx context.Context, user, group string, taskTypes []uint32, ...) ([]*async_task.Task, error)
- func Init(ctx context.Context, db *gorm.DB, options ...AsyncOption) error
- func PauseTask(ctx context.Context, taskID uint32) error
- func RegisterTask(taskTyp uint32, newTask async_task.ITaskFunc) error
- func RunTask(ctx context.Context, taskID uint32) error
- func Stop()
- type AsyncOption
- func WithLogger(logger async_config.Logger) AsyncOption
- func WithPendingDelQueue(pendingDel async_component.IQueue) AsyncOption
- func WithPendingRunQueue(pendingRun async_component.IQueue) AsyncOption
- func WithRunMaxConcurrency(max int) AsyncOption
- func WithRunTaskIntervalSecond(interval int) AsyncOption
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CreateTask ¶
func GetTasks ¶
func GetTasks(ctx context.Context, user, group string, taskTypes []uint32, states []async_task.State, offset, limit int32) ([]*async_task.Task, error)
func RegisterTask ¶
func RegisterTask(taskTyp uint32, newTask async_task.ITaskFunc) error
Types ¶
type AsyncOption ¶
type AsyncOption interface {
// contains filtered or unexported methods
}
func WithLogger ¶
func WithLogger(logger async_config.Logger) AsyncOption
func WithPendingDelQueue ¶
func WithPendingDelQueue(pendingDel async_component.IQueue) AsyncOption
func WithPendingRunQueue ¶
func WithPendingRunQueue(pendingRun async_component.IQueue) AsyncOption
func WithRunMaxConcurrency ¶ added in v1.0.1
func WithRunMaxConcurrency(max int) AsyncOption
func WithRunTaskIntervalSecond ¶ added in v1.0.1
func WithRunTaskIntervalSecond(interval int) AsyncOption
Click to show internal directories.
Click to hide internal directories.