55 "log"
66 "time"
77
8+ "github.com/cschleiden/go-workflows/backend"
89 "github.com/cschleiden/go-workflows/client"
910 "github.com/cschleiden/go-workflows/samples"
1011 "github.com/cschleiden/go-workflows/worker"
@@ -17,7 +18,7 @@ func main() {
1718 ctx , cancel := context .WithCancel (context .Background ())
1819 defer cancel ()
1920
20- backend := samples .GetBackend ("orchestrator" )
21+ backend := samples .GetBackend ("orchestrator" , backend . WithWorkerName ( "orchestrator-worker" ) )
2122
2223 orchestrator := worker .NewWorkflowOrchestrator (
2324 backend ,
@@ -57,9 +58,9 @@ func main() {
5758
5859// SimpleWorkflow is a basic workflow that calls an activity and returns its result
5960func SimpleWorkflow (ctx workflow.Context , message string ) (string , error ) {
60- future := workflow .ExecuteActivity [string ](ctx , workflow .DefaultActivityOptions , ProcessMessage , message )
61+ f := workflow .ExecuteActivity [string ](ctx , workflow .DefaultActivityOptions , ProcessMessage , message )
6162
62- result , err := future .Get (ctx )
63+ result , err := f .Get (ctx )
6364 if err != nil {
6465 return "" , err
6566 }
@@ -72,5 +73,3 @@ func SimpleWorkflow(ctx workflow.Context, message string) (string, error) {
7273func ProcessMessage (ctx context.Context , message string ) (string , error ) {
7374 return message + " (processed by activity)" , nil
7475}
75-
76- // Note: No separate activity function needed when using InlineActivity
0 commit comments