5
5
"log"
6
6
"time"
7
7
8
+ "github.com/cschleiden/go-workflows/backend"
8
9
"github.com/cschleiden/go-workflows/client"
9
10
"github.com/cschleiden/go-workflows/samples"
10
11
"github.com/cschleiden/go-workflows/worker"
@@ -17,7 +18,7 @@ func main() {
17
18
ctx , cancel := context .WithCancel (context .Background ())
18
19
defer cancel ()
19
20
20
- backend := samples .GetBackend ("orchestrator" )
21
+ backend := samples .GetBackend ("orchestrator" , backend . WithWorkerName ( "orchestrator-worker" ) )
21
22
22
23
orchestrator := worker .NewWorkflowOrchestrator (
23
24
backend ,
@@ -57,9 +58,9 @@ func main() {
57
58
58
59
// SimpleWorkflow is a basic workflow that calls an activity and returns its result
59
60
func 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 )
61
62
62
- result , err := future .Get (ctx )
63
+ result , err := f .Get (ctx )
63
64
if err != nil {
64
65
return "" , err
65
66
}
@@ -72,5 +73,3 @@ func SimpleWorkflow(ctx workflow.Context, message string) (string, error) {
72
73
func ProcessMessage (ctx context.Context , message string ) (string , error ) {
73
74
return message + " (processed by activity)" , nil
74
75
}
75
-
76
- // Note: No separate activity function needed when using InlineActivity
0 commit comments