Skip to content

Commit

Permalink
my-app: change signature machine.Handle(ctx,...)
Browse files Browse the repository at this point in the history
  • Loading branch information
widmogrod committed May 11, 2024
1 parent e4bde3d commit ab496ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/my-app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func main() {

// apply command
work := workflow.NewMachine(di, state.Data)
err = work.Handle(cmd)
err = work.Handle(context.TODO(), cmd)
if err != nil {
log.Errorf("failed to handle command: %v", err)
return nil, err
Expand All @@ -576,7 +576,7 @@ func main() {
proc := &taskqueue.FunctionProcessor[schemaless.Record[workflow.State]]{
F: func(task taskqueue.Task[schemaless.Record[workflow.State]]) {
work := workflow.NewMachine(di, task.Data.Data)
err := work.Handle(&workflow.Run{})
err := work.Handle(context.TODO(), &workflow.Run{})
if err != nil {
log.Errorf("err: %s", err)
return
Expand All @@ -596,7 +596,7 @@ func main() {

if next := workflow.ScheduleNext(newState, di); next != nil {
work := workflow.NewMachine(di, nil)
err := work.Handle(next)
err := work.Handle(context.TODO(), next)
if err != nil {
log.Infof("err: %s", err)
return
Expand Down Expand Up @@ -773,7 +773,7 @@ func (service *Service[Dep, CMD, State]) CreateOrUpdate(cmd CMD) (res State, err
}

work := service.newMachine(res)
err = work.Handle(cmd)
err = work.Handle(context.TODO(), cmd)
if err != nil {
log.Errorf("failed to handle command: %v", err)
return res, err
Expand Down

0 comments on commit ab496ad

Please sign in to comment.