Documentation ¶
Index ¶
- type Config
- type DAL
- type ExecuteCallFunc
- type Scheduler
- type Service
- func (s *Service) CreatedOrReplacedDeloyment(ctx context.Context, newDeploymentKey model.DeploymentKey)
- func (s *Service) NewCronJobsForModule(ctx context.Context, module *schemapb.Module) ([]model.CronJob, error)
- func (s *Service) UpdatedControllerList(ctx context.Context, controllers []dal.Controller)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAL ¶
type DAL interface { GetCronJobs(ctx context.Context) ([]model.CronJob, error) StartCronJobs(ctx context.Context, jobs []model.CronJob) (attemptedJobs []dal.AttemptedCronJob, err error) EndCronJob(ctx context.Context, job model.CronJob, next time.Time) (model.CronJob, error) GetStaleCronJobs(ctx context.Context, duration time.Duration) ([]model.CronJob, error) }
type ExecuteCallFunc ¶
type Scheduler ¶
type Scheduler interface { Singleton(retry backoff.Backoff, job scheduledtask.Job) Parallel(retry backoff.Backoff, job scheduledtask.Job) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, key model.ControllerKey, requestSource string, config Config, dal DAL, scheduler Scheduler, call ExecuteCallFunc) *Service
func NewForTesting ¶
func (*Service) CreatedOrReplacedDeloyment ¶
func (s *Service) CreatedOrReplacedDeloyment(ctx context.Context, newDeploymentKey model.DeploymentKey)
CreatedOrReplacedDeloyment is only called by the responsible controller to its cron service, and will not be received by the other cron services. When a controller creates/replaces a deployment, its cron job service is responsible for the newly created cron jobs until other controllers have a chance to resync their list of jobs and start sharing responsibility of the new cron jobs.
func (*Service) NewCronJobsForModule ¶
func (*Service) UpdatedControllerList ¶
func (s *Service) UpdatedControllerList(ctx context.Context, controllers []dal.Controller)
UpdatedControllerList synchronises the hash ring with the active controllers.
Click to show internal directories.
Click to hide internal directories.