Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alist-org
GitHub Repository: alist-org/alist
Path: blob/main/internal/task/manager.go
1560 views
1
package task
2
3
import "github.com/xhofe/tache"
4
5
type Manager[T tache.Task] interface {
6
Add(task T)
7
Cancel(id string)
8
CancelAll()
9
CancelByCondition(condition func(task T) bool)
10
GetAll() []T
11
GetByID(id string) (T, bool)
12
GetByState(state ...tache.State) []T
13
GetByCondition(condition func(task T) bool) []T
14
Remove(id string)
15
RemoveAll()
16
RemoveByState(state ...tache.State)
17
RemoveByCondition(condition func(task T) bool)
18
Retry(id string)
19
RetryAllFailed()
20
}
21
22