handler

package
v0.0.0-...-0485310 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 34 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(svc interfaces.TaskHandlerService)

func WithCancelTimeout

func WithCancelTimeout(timeout time.Duration) Option

func WithConfigPath

func WithConfigPath(path string) Option

func WithExitWatchDuration

func WithExitWatchDuration(duration time.Duration) Option

func WithReportInterval

func WithReportInterval(interval time.Duration) Option

type RunnerOption

type RunnerOption func(r interfaces.TaskRunner)

func WithSubscribeTimeout

func WithSubscribeTimeout(timeout time.Duration) RunnerOption

type RunnerV2

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

func NewTaskRunnerV2

func NewTaskRunnerV2(id primitive.ObjectID, svc *ServiceV2) (r2 *RunnerV2, err error)

func (*RunnerV2) Cancel

func (r *RunnerV2) Cancel() (err error)

func (*RunnerV2) CleanUp

func (r *RunnerV2) CleanUp() (err error)

CleanUp clean up task runner

func (*RunnerV2) GetTaskId

func (r *RunnerV2) GetTaskId() (id primitive.ObjectID)

func (*RunnerV2) Init

func (r *RunnerV2) Init() (err error)

func (*RunnerV2) Run

func (r *RunnerV2) Run() (err error)

func (*RunnerV2) SetSubscribeTimeout

func (r *RunnerV2) SetSubscribeTimeout(timeout time.Duration)

type ServiceV2

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

func GetTaskHandlerServiceV2

func GetTaskHandlerServiceV2() (svr *ServiceV2, err error)

func (*ServiceV2) Cancel

func (svc *ServiceV2) Cancel(taskId primitive.ObjectID) (err error)

func (*ServiceV2) Fetch

func (svc *ServiceV2) Fetch()

func (*ServiceV2) GetCancelTimeout

func (svc *ServiceV2) GetCancelTimeout() (timeout time.Duration)

func (*ServiceV2) GetCurrentNode

func (svc *ServiceV2) GetCurrentNode() (n *models2.NodeV2, err error)

func (*ServiceV2) GetExitWatchDuration

func (svc *ServiceV2) GetExitWatchDuration() (duration time.Duration)

func (*ServiceV2) GetFetchInterval

func (svc *ServiceV2) GetFetchInterval() (interval time.Duration)

func (*ServiceV2) GetNodeConfigService

func (svc *ServiceV2) GetNodeConfigService() (cfgSvc interfaces.NodeConfigService)

func (*ServiceV2) GetReportInterval

func (svc *ServiceV2) GetReportInterval() (interval time.Duration)

func (*ServiceV2) GetSpiderById

func (svc *ServiceV2) GetSpiderById(id primitive.ObjectID) (s *models2.SpiderV2, err error)

func (*ServiceV2) GetTaskById

func (svc *ServiceV2) GetTaskById(id primitive.ObjectID) (t *models2.TaskV2, err error)

func (*ServiceV2) IsSyncLocked

func (svc *ServiceV2) IsSyncLocked(path string) (ok bool)

func (*ServiceV2) LockSync

func (svc *ServiceV2) LockSync(path string)

func (*ServiceV2) ReportStatus

func (svc *ServiceV2) ReportStatus()

func (*ServiceV2) Reset

func (svc *ServiceV2) Reset()

func (*ServiceV2) Run

func (svc *ServiceV2) Run(taskId primitive.ObjectID) (err error)

func (*ServiceV2) SetCancelTimeout

func (svc *ServiceV2) SetCancelTimeout(timeout time.Duration)

func (*ServiceV2) SetExitWatchDuration

func (svc *ServiceV2) SetExitWatchDuration(duration time.Duration)

func (*ServiceV2) SetFetchInterval

func (svc *ServiceV2) SetFetchInterval(interval time.Duration)

func (*ServiceV2) SetReportInterval

func (svc *ServiceV2) SetReportInterval(interval time.Duration)

func (*ServiceV2) Start

func (svc *ServiceV2) Start()

func (*ServiceV2) UnlockSync

func (svc *ServiceV2) UnlockSync(path string)

Jump to

Keyboard shortcuts

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