File size: 477 Bytes
619f93d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package task

import (
	"github.com/OpenListTeam/tache"
)

type Manager[T tache.Task] interface {
	Add(task T)
	Cancel(id string)
	CancelAll()
	CancelByCondition(condition func(task T) bool)
	GetAll() []T
	GetByID(id string) (T, bool)
	GetByState(state ...tache.State) []T
	GetByCondition(condition func(task T) bool) []T
	Remove(id string)
	RemoveAll()
	RemoveByState(state ...tache.State)
	RemoveByCondition(condition func(task T) bool)
	Retry(id string)
	RetryAllFailed()
}