Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Extend worker.Worker to support periodic job registration
Browse files Browse the repository at this point in the history
  • Loading branch information
acaloiaro committed Sep 5, 2022
1 parent 89ed84d commit 50bd715
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions worker/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ func (w *Simple) PerformIn(job Job, d time.Duration) error {
return nil
}

// RegisterPeriodic is currently a no-op and should be implemented
func (w *Simple) RegisterPeriodic(cronSpec, jobName string, h Handler) error {
return nil
}

// SimpleLogger is used by the Simple worker to write logs
type SimpleLogger interface {
Debugf(string, ...interface{})
Expand Down
2 changes: 2 additions & 0 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type Worker interface {
PerformIn(Job, time.Duration) error
// Register a Handler
Register(string, Handler) error
// RegisterPeriodic performs a job periodically according to the provided cron spec
RegisterPeriodic(cronSpec, jobName string, h Handler) error
}

/* TODO(sio4): #road-to-v1 - redefine Worker interface clearer
Expand Down

0 comments on commit 50bd715

Please sign in to comment.