Documentation ¶
Index ¶
- func GetManagerResource(ctx context.Context) *rest_client.Resource
- func StartCronTasks()
- func StartRetryTask(maxMinutes int, taskParam *RetryTaskParam)
- func StopCronTasks()
- type CronTask
- type Pipe
- type RetryTaskParam
- type Task
- type TaskContext
- func (this *TaskContext) GetCtx() context.Context
- func (this *TaskContext) GetOrm() *gorm.DB
- func (this *TaskContext) GetResource() *rest_client.Resource
- func (this *TaskContext) Init(ctx context.Context, o *gorm.DB, resource *rest_client.Resource)
- func (this *TaskContext) SetCtx(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetManagerResource ¶
func GetManagerResource(ctx context.Context) *rest_client.Resource
func StartCronTasks ¶
func StartCronTasks()
func StartRetryTask ¶
func StartRetryTask(maxMinutes int, taskParam *RetryTaskParam)
func StopCronTasks ¶
func StopCronTasks()
Types ¶
type CronTask ¶
type CronTask struct {
// contains filtered or unexported fields
}
func RegisterCronTask ¶
func RegisterPipeTask ¶
func RegisterTask ¶
func RegisterTaskInRestMode ¶
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
func (Pipe) GetConsumerCount ¶
GetConsumerCount 消费者数量 默认为通道容量十分之一
func (Pipe) RunConsumer ¶
type RetryTaskParam ¶
type RetryTaskParam struct { NewContext func() context.Context GetDatas func() []interface{} BeforeAction func(data interface{}) error DoAction func(ctx context.Context, times int, data interface{}) error AfterActionSuccess func(data interface{}) error AfterActionFail func(data interface{}) error GetTaskDataId func(data interface{}) string RecordFailByPanic func(data interface{}, error string) }
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func (*Task) IsEnableTx ¶
func (*Task) Run ¶
func (t *Task) Run(taskContext *TaskContext) error
type TaskContext ¶
type TaskContext struct {
// contains filtered or unexported fields
}
func (*TaskContext) GetCtx ¶
func (this *TaskContext) GetCtx() context.Context
func (*TaskContext) GetOrm ¶
func (this *TaskContext) GetOrm() *gorm.DB
func (*TaskContext) GetResource ¶
func (this *TaskContext) GetResource() *rest_client.Resource
func (*TaskContext) Init ¶
func (this *TaskContext) Init(ctx context.Context, o *gorm.DB, resource *rest_client.Resource)
func (*TaskContext) SetCtx ¶
func (this *TaskContext) SetCtx(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.