feat(archive): archive manage (#7817)
* feat(archive): archive management * fix(ftp-server): remove duplicate ReadAtSeeker realization * fix(archive): bad seeking of SeekableStream * fix(archive): split internal and driver extraction api * feat(archive): patch * fix(shutdown): clear decompress upload tasks * chore * feat(archive): support .iso format * chore
This commit is contained in:
20
internal/task/manager.go
Normal file
20
internal/task/manager.go
Normal file
@ -0,0 +1,20 @@
|
||||
package task
|
||||
|
||||
import "github.com/xhofe/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()
|
||||
}
|
Reference in New Issue
Block a user