Create example workflow
This commit is contained in:
@@ -10,10 +10,8 @@ import (
|
||||
"git.gorlug.de/code/ersteller/schema/ent"
|
||||
)
|
||||
|
||||
type StepHandler interface {
|
||||
Handle(ctx context.Context, currentStep *Step,
|
||||
job queue.GeneralQueueJob) (queue.GeneralQueueHandlerResult, *Step, error)
|
||||
}
|
||||
type StepHandler func(ctx context.Context, currentStep *Step,
|
||||
job queue.GeneralQueueJob) (queue.GeneralQueueHandlerResult, *Step, error)
|
||||
|
||||
type StepParams struct {
|
||||
Name string
|
||||
@@ -60,7 +58,7 @@ func (s *Step) Execute(ctx context.Context, payload map[string]interface{}) erro
|
||||
}
|
||||
|
||||
func (s *Step) HandleQueue(ctx context.Context, job queue.GeneralQueueJob) (queue.GeneralQueueHandlerResult, error) {
|
||||
result, nextStep, err := s.Handler.Handle(ctx, s, job)
|
||||
result, nextStep, err := s.Handler(ctx, s, job)
|
||||
if err != nil {
|
||||
return result, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user