type MySubTask struct { Sensor string Value float64 } type Task struct{} func (t *Task) Execute(ctx context.Context) error { err := workflows.SubmitSubtasks(ctx, []workflows.Task{ &MySubTask{ Sensor: "A", Value: 42, }, &MySubTask{ Sensor: "B", Value: 42, } }, ) if err != nil { return fmt.Errorf("failed to submit subtasks: %w", err) } return nil }
workflows.SubmitSubtasks( ctx context.Context, tasks []workflows.Task, options ...subtask.SubmitOption, ) ([]subtask.FutureTask, error)
Was this page helpful?