Documentation ¶
Index ¶
- func WithPreemptInterval(t time.Duration) option.Option[Storage]
- func WithPreemptTimeout(t time.Duration) option.Option[Storage]
- func WithRefreshInterval(t time.Duration) option.Option[Storage]
- func WithRefreshRetry(r storage.RetryStrategy) option.Option[Storage]
- type Storage
- func (s *Storage) Add(ctx context.Context, t *task.Task) (int64, error)
- func (s *Storage) AddExecution(ctx context.Context, taskId int64) (int64, error)
- func (s *Storage) AutoLookup(ctx context.Context)
- func (s *Storage) AutoRefresh(ctx context.Context)
- func (s *Storage) CompareAndUpdateTaskExecutionStatus(ctx context.Context, taskId int64, old, new string) error
- func (s *Storage) CompareAndUpdateTaskStatus(ctx context.Context, taskId int64, old, new string) error
- func (s *Storage) Delete(ctx context.Context, taskId int64) error
- func (s *Storage) Events(ctx context.Context, taskEvents <-chan task.Event) (<-chan storage.Event, error)
- func (s *Storage) Get(ctx context.Context, taskId int64) (*task.Task, error)
- func (s *Storage) RunPreempt(ctx context.Context)
- func (s *Storage) Stop(ctx context.Context) error
- func (s *Storage) Update(ctx context.Context, t *task.Task) error
- type StorageInfo
- type TaskExecution
- type TaskInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithRefreshRetry ¶
func WithRefreshRetry(r storage.RetryStrategy) option.Option[Storage]
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewMysqlStorage ¶
func (*Storage) AddExecution ¶
AddExecution 创建一条执行记录
func (*Storage) AutoLookup ¶
func (*Storage) AutoRefresh ¶
func (*Storage) CompareAndUpdateTaskExecutionStatus ¶
func (*Storage) CompareAndUpdateTaskStatus ¶
func (*Storage) RunPreempt ¶
RunPreempt 每隔固定时间去db中抢占任务
type StorageInfo ¶
type TaskExecution ¶
Click to show internal directories.
Click to hide internal directories.