task

package
v2.0.2-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSame added in v2.0.2

func IsSame(task1, task2 *types.SeedTask) bool

IsSame check whether the two task provided are the same

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is an implementation of the interface of TaskMgr.

func NewManager

func NewManager(cfg *config.Config, cdnMgr supervisor.CDNMgr, progressMgr supervisor.SeedProgressMgr) (*Manager, error)

NewManager returns a new Manager Object.

func (*Manager) AddOrUpdate added in v2.0.2

func (tm *Manager) AddOrUpdate(registerTask *types.SeedTask) (seedTask *types.SeedTask, err error)

func (Manager) Delete

func (tm Manager) Delete(taskID string) error

func (Manager) Exist

func (tm Manager) Exist(taskID string) (*types.SeedTask, bool)

func (*Manager) GC

func (tm *Manager) GC() error

func (Manager) Get

func (tm Manager) Get(taskID string) (*types.SeedTask, error)

func (*Manager) GetPieces

func (tm *Manager) GetPieces(ctx context.Context, taskID string) (pieces []*types.SeedPiece, err error)

func (*Manager) Register

func (tm *Manager) Register(ctx context.Context, registerTask *types.SeedTask) (pieceChan <-chan *types.SeedPiece, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL