-
-
Notifications
You must be signed in to change notification settings - Fork 578
Extend worker.Worker
to support periodic job registration
#2308
Conversation
Please change the merge target to |
Hi @acaloiaro, sorry for my late response. It seems like you worked based on the |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days. |
- Provide a concrete periodic `worker.Simple` implementation
I went ahead and rebased, and provided a concrete |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, this is a breaking change invalidates all existing (official/unofficial/custom) implementations. It should be considered as a separate interface or extended when we redesign the Worker support in a future major version.
(will add more comments in #2351)
Closing for now while a more holistic design is considered in #2242 |
Extend
worker.Worker
to support periodic job registration, in support of gobuffalo/gocraft-work-adapter#6The purpose of this PR is to invite commentary on adding periodic job support. A concrete
worker.Simple
implementation would follow, along with tests.