sync

package
v0.0.0-...-e417875 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PolicyLoader

type PolicyLoader func() ([]*period.Policy, error)

PolicyLoader is a func template to load schedule policies from js datastore.

type Worker

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

Worker is designed to sync the schedules in the database into jobservice datastore.

func New

func New(maxRounds uint8) *Worker

New sync worker.

func (*Worker) Run

func (w *Worker) Run(ctx context.Context) error

Run one round.

func (*Worker) Start

func (w *Worker) Start() error

Start the loop in none-blocking way.

func (*Worker) UseCoreExecutionManager

func (w *Worker) UseCoreExecutionManager(executionMgr task.ExecutionManager) *Worker

UseCoreExecutionManager refers the core execution manager.

func (*Worker) UseCoreScheduler

func (w *Worker) UseCoreScheduler(scheduler scheduler.Scheduler) *Worker

UseCoreScheduler refers the core scheduler.

func (*Worker) UseCoreTaskManager

func (w *Worker) UseCoreTaskManager(taskManager task.Manager) *Worker

UseCoreTaskManager refers the core task manager.

func (*Worker) UseManager

func (w *Worker) UseManager(mgr mgt.Manager) *Worker

UseManager refers the mgt.Manager.

func (*Worker) UseMonitorRedisClient

func (w *Worker) UseMonitorRedisClient(redisConfig *config.RedisPoolConfig) *Worker

UseMonitorRedisClient refers the monitor redis client.

func (*Worker) UseQueueStatusManager

func (w *Worker) UseQueueStatusManager(queueStatusManager queuestatus.Manager) *Worker

UseQueueStatusManager refers the queue status manager.

func (*Worker) UseScheduler

func (w *Worker) UseScheduler(scheduler period.Scheduler) *Worker

UseScheduler refers the period.Scheduler.

func (*Worker) WithContext

func (w *Worker) WithContext(ctx *env.Context) *Worker

WithContext set context.

func (*Worker) WithCoreInternalAddr

func (w *Worker) WithCoreInternalAddr(addr string) *Worker

WithCoreInternalAddr sets the internal addr of core.

func (*Worker) WithPolicyLoader

func (w *Worker) WithPolicyLoader(loader PolicyLoader) *Worker

WithPolicyLoader determines the policy loader func.

Jump to

Keyboard shortcuts

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