Documentation ¶
Index ¶
- type Option
- type Options
- type SchedulerService
- func (s *SchedulerService) GenerateTaskID(url string, meta *base.UrlMeta, peerID string) (taskID string)
- func (s *SchedulerService) GetOrCreateTask(ctx context.Context, task *supervisor.Task) *supervisor.Task
- func (s *SchedulerService) GetPeerTask(peerTaskID string) (peerTask *supervisor.Peer, ok bool)
- func (s *SchedulerService) HandleLeaveTask(ctx context.Context, peer *supervisor.Peer) error
- func (s *SchedulerService) HandlePeerResult(ctx context.Context, peer *supervisor.Peer, ...) error
- func (s *SchedulerService) HandlePieceResult(ctx context.Context, peer *supervisor.Peer, ...) error
- func (s *SchedulerService) RegisterPeerTask(req *schedulerRPC.PeerTaskRequest, task *supervisor.Task) *supervisor.Peer
- func (s *SchedulerService) SelectParent(peer *supervisor.Peer) (parent *supervisor.Peer, err error)
- func (s *SchedulerService) Serve()
- func (s *SchedulerService) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SchedulerService ¶
type SchedulerService struct {
// contains filtered or unexported fields
}
func NewSchedulerService ¶
func NewSchedulerService(cfg *config.SchedulerConfig, dynConfig config.DynconfigInterface, options ...Option) (*SchedulerService, error)
func (*SchedulerService) GenerateTaskID ¶
func (*SchedulerService) GetOrCreateTask ¶
func (s *SchedulerService) GetOrCreateTask(ctx context.Context, task *supervisor.Task) *supervisor.Task
func (*SchedulerService) GetPeerTask ¶
func (s *SchedulerService) GetPeerTask(peerTaskID string) (peerTask *supervisor.Peer, ok 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()
Click to show internal directories.
Click to hide internal directories.