Documentation
¶
Index ¶
- func FromJobs(jobs []*cronext.Job) []interface{}
- func ToJob(v interface{}) *cronext.Job
- func ToJobs(v []interface{}) []*cronext.Job
- type DistributedScheduler
- func (s *DistributedScheduler) AddJob(jobInterface interface{}) error
- func (s *DistributedScheduler) GetJob(jobID string) (interface{}, error)
- func (s *DistributedScheduler) IsLeader() bool
- func (s *DistributedScheduler) IsRunning() bool
- func (s *DistributedScheduler) ListJobs() ([]interface{}, error)
- func (s *DistributedScheduler) RemoveJob(jobID string) error
- func (s *DistributedScheduler) Start(ctx context.Context) error
- func (s *DistributedScheduler) Stop(ctx context.Context) error
- func (s *DistributedScheduler) TriggerJob(ctx context.Context, jobID string) (string, error)
- func (s *DistributedScheduler) UpdateJob(jobInterface interface{}) error
- type SimpleScheduler
- func (s *SimpleScheduler) AddJob(jobInterface interface{}) error
- func (s *SimpleScheduler) GetJob(jobID string) (interface{}, error)
- func (s *SimpleScheduler) IsLeader() bool
- func (s *SimpleScheduler) IsRunning() bool
- func (s *SimpleScheduler) ListJobs() ([]interface{}, error)
- func (s *SimpleScheduler) RemoveJob(jobID string) error
- func (s *SimpleScheduler) Start(ctx context.Context) error
- func (s *SimpleScheduler) Stop(ctx context.Context) error
- func (s *SimpleScheduler) TriggerJob(ctx context.Context, jobID string) (string, error)
- func (s *SimpleScheduler) UpdateJob(jobInterface interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DistributedScheduler ¶
type DistributedScheduler struct {
// contains filtered or unexported fields
}
DistributedScheduler implements a distributed scheduler with leader election. This is a placeholder implementation that needs to be completed.
func NewDistributedScheduler ¶
func NewDistributedScheduler( config cronext.Config, storage cronext.Storage, executor *cronext.Executor, registry *cronext.JobRegistry, logger forge.Logger, ) (*DistributedScheduler, error)
NewDistributedScheduler creates a new distributed scheduler. TODO: Implement full distributed scheduler with consensus extension integration.
func (*DistributedScheduler) AddJob ¶
func (s *DistributedScheduler) AddJob(jobInterface interface{}) error
AddJob adds a job to the scheduler.
func (*DistributedScheduler) GetJob ¶
func (s *DistributedScheduler) GetJob(jobID string) (interface{}, error)
GetJob retrieves a job by ID.
func (*DistributedScheduler) IsLeader ¶
func (s *DistributedScheduler) IsLeader() bool
IsLeader returns whether this node is the leader.
func (*DistributedScheduler) IsRunning ¶
func (s *DistributedScheduler) IsRunning() bool
IsRunning returns whether the scheduler is running.
func (*DistributedScheduler) ListJobs ¶
func (s *DistributedScheduler) ListJobs() ([]interface{}, error)
ListJobs lists all jobs.
func (*DistributedScheduler) RemoveJob ¶
func (s *DistributedScheduler) RemoveJob(jobID string) error
RemoveJob removes a job from the scheduler.
func (*DistributedScheduler) Start ¶
func (s *DistributedScheduler) Start(ctx context.Context) error
Start starts the distributed scheduler.
func (*DistributedScheduler) Stop ¶
func (s *DistributedScheduler) Stop(ctx context.Context) error
Stop stops the distributed scheduler.
func (*DistributedScheduler) TriggerJob ¶
TriggerJob manually triggers a job execution.
func (*DistributedScheduler) UpdateJob ¶
func (s *DistributedScheduler) UpdateJob(jobInterface interface{}) error
UpdateJob updates a job in the scheduler.
type SimpleScheduler ¶
type SimpleScheduler struct {
// contains filtered or unexported fields
}
SimpleScheduler implements a single-node scheduler using robfig/cron. This scheduler runs on a single instance without distributed coordination.
func NewSimpleScheduler ¶
func NewSimpleScheduler( config cronext.Config, storage cronext.Storage, executor *cronext.Executor, registry *cronext.JobRegistry, logger forge.Logger, ) (*SimpleScheduler, error)
NewSimpleScheduler creates a new simple scheduler.
func (*SimpleScheduler) AddJob ¶
func (s *SimpleScheduler) AddJob(jobInterface interface{}) error
AddJob adds a job to the scheduler.
func (*SimpleScheduler) GetJob ¶
func (s *SimpleScheduler) GetJob(jobID string) (interface{}, error)
GetJob retrieves a job by ID.
func (*SimpleScheduler) IsLeader ¶
func (s *SimpleScheduler) IsLeader() bool
IsLeader always returns true for simple scheduler (no distributed coordination).
func (*SimpleScheduler) IsRunning ¶
func (s *SimpleScheduler) IsRunning() bool
IsRunning returns whether the scheduler is running.
func (*SimpleScheduler) ListJobs ¶
func (s *SimpleScheduler) ListJobs() ([]interface{}, error)
ListJobs lists all jobs.
func (*SimpleScheduler) RemoveJob ¶
func (s *SimpleScheduler) RemoveJob(jobID string) error
RemoveJob removes a job from the scheduler.
func (*SimpleScheduler) Start ¶
func (s *SimpleScheduler) Start(ctx context.Context) error
Start starts the scheduler and loads jobs from storage.
func (*SimpleScheduler) Stop ¶
func (s *SimpleScheduler) Stop(ctx context.Context) error
Stop stops the scheduler gracefully.
func (*SimpleScheduler) TriggerJob ¶
TriggerJob manually triggers a job execution.
func (*SimpleScheduler) UpdateJob ¶
func (s *SimpleScheduler) UpdateJob(jobInterface interface{}) error
UpdateJob updates a job in the scheduler.