37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"beacon/activities"
|
|
"beacon/workflows"
|
|
"go.temporal.io/sdk/client"
|
|
"go.temporal.io/sdk/worker"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
// Create a Temporal client with the default options.
|
|
c, err := client.Dial(client.Options{HostPort: "temporal.newai.day:17233"})
|
|
if err != nil {
|
|
log.Fatalln("Unable to create Temporal client", err)
|
|
}
|
|
defer c.Close()
|
|
|
|
taskQueue := "test-task-queue"
|
|
|
|
// Create a Worker that listens on the specified Task Queue.
|
|
w := worker.New(c, taskQueue, worker.Options{})
|
|
|
|
// Register the Workflow and the real Go suffix Activity with the Worker.
|
|
w.RegisterWorkflow(workflows.TestRunWorkflow)
|
|
w.RegisterActivity(activities.AddSuffixActivity)
|
|
//(for later) w.RegisterActivity(activities.AddSuffixActivity)
|
|
|
|
// Note: The Python and ts activities will be handled by the Python/ts worker and is not registered here.
|
|
|
|
// Start the Worker. This call blocks until the Worker is interrupted.
|
|
err = w.Run(worker.InterruptCh())
|
|
if err != nil {
|
|
log.Fatalln("Unable to start Worker", err)
|
|
}
|
|
}
|