task

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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, peerMgr mgr.PeerMgr, dfgetTaskMgr mgr.DfgetTaskMgr,
	progressMgr mgr.ProgressMgr, cdnMgr mgr.CDNMgr, schedulerMgr mgr.SchedulerMgr) (*Manager, error)

NewManager returns a new Manager Object.

func (*Manager) CheckTaskStatus

func (tm *Manager) CheckTaskStatus(ctx context.Context, taskID string) (bool, error)

CheckTaskStatus check the task status.

func (*Manager) Delete

func (tm *Manager) Delete(ctx context.Context, taskID string) error

Delete deletes a task.

func (*Manager) Get

func (tm *Manager) Get(ctx context.Context, taskID string) (*types.TaskInfo, error)

Get a task info according to specified taskID.

func (*Manager) GetPieces

func (tm *Manager) GetPieces(ctx context.Context, taskID, clientID string, req *types.PiecePullRequest) (bool, interface{}, error)

GetPieces get the pieces to be downloaded based on the scheduling result.

func (*Manager) List

func (tm *Manager) List(ctx context.Context, filter map[string]string) ([]*types.TaskInfo, error)

List returns a list of tasks with filter. TODO: implement it.

func (*Manager) Register

func (tm *Manager) Register(ctx context.Context, req *types.TaskCreateRequest) (taskCreateResponse *types.TaskCreateResponse, err error)

Register will not only register a task.

func (*Manager) Update

func (tm *Manager) Update(ctx context.Context, taskID string, taskInfo *types.TaskInfo) error

Update the info of task.

func (*Manager) UpdatePieceStatus

func (tm *Manager) UpdatePieceStatus(ctx context.Context, taskID, pieceRange string, pieceUpdateRequest *types.PieceUpdateRequest) error

UpdatePieceStatus update the piece status with specified parameters.

Jump to

Keyboard shortcuts

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