mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-07-19 01:48:42 +08:00
23 lines
477 B
Go
23 lines
477 B
Go
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()
|
|
}
|