Add cron tasks to distillery
This commit is contained in:
parent
790460f9de
commit
f52fe6abf3
19 changed files with 353 additions and 141 deletions
16
internal/dis/component/cron.go
Normal file
16
internal/dis/component/cron.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package component
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// Cronable is a component that implements a cron method
|
||||
type Cronable interface {
|
||||
Component
|
||||
|
||||
// Name of the cron task being performed
|
||||
TaskName() string
|
||||
|
||||
// Cron is called to run this cron task
|
||||
Cron(ctx context.Context) error
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue