core

package
v2.0.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(options *Options)

func WithDisableCDN

func WithDisableCDN(disableCDN bool) Option

func WithOpenTel

func WithOpenTel(openTel bool) Option

type Options

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

type SchedulerService

type SchedulerService struct {
	// CDN manager
	CDN supervisor.CDN
	// contains filtered or unexported fields
}

func NewSchedulerService

func NewSchedulerService(cfg *config.SchedulerConfig, dynConfig config.DynconfigInterface, gc gc.GC, options ...Option) (*SchedulerService, error)

func (*SchedulerService) GenerateTaskID

func (s *SchedulerService) GenerateTaskID(url string, meta *base.UrlMeta, peerID string) string

func (*SchedulerService) GetOrCreateTask

func (s *SchedulerService) GetOrCreateTask(ctx context.Context, task *supervisor.Task) *supervisor.Task

func (*SchedulerService) GetPeer added in v2.0.1

func (s *SchedulerService) GetPeer(id string) (*supervisor.Peer, bool)

func (*SchedulerService) HandleLeaveTask

func (s *SchedulerService) HandleLeaveTask(ctx context.Context, peer *supervisor.Peer) error

func (*SchedulerService) HandlePeerResult

func (s *SchedulerService) HandlePeerResult(ctx context.Context, peer *supervisor.Peer, peerResult *schedulerRPC.PeerResult) error

func (*SchedulerService) HandlePieceResult

func (s *SchedulerService) HandlePieceResult(ctx context.Context, peer *supervisor.Peer, pieceResult *schedulerRPC.PieceResult) error

func (*SchedulerService) RegisterPeerTask

func (s *SchedulerService) RegisterPeerTask(req *schedulerRPC.PeerTaskRequest, task *supervisor.Task) *supervisor.Peer

func (*SchedulerService) SelectParent

func (s *SchedulerService) SelectParent(peer *supervisor.Peer) (parent *supervisor.Peer, err error)

func (*SchedulerService) Serve

func (s *SchedulerService) Serve()

func (*SchedulerService) Stop

func (s *SchedulerService) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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