Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
func (*Task) UsingSlave ¶
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() orm.Ormer
func (*TaskContext) GetResource ¶
func (this *TaskContext) GetResource() *vanilla.Resource
Click to show internal directories.
Click to hide internal directories.