File tree Expand file tree Collapse file tree 8 files changed +19
-15
lines changed
Expand file tree Collapse file tree 8 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "sync"
2828 "time"
2929
30+ "github.com/dapr/durabletask-go/workflow"
3031 "github.com/dapr/go-sdk/actor"
3132 "github.com/dapr/go-sdk/actor/config"
3233 "github.com/dapr/go-sdk/client/internal"
@@ -288,6 +289,15 @@ func NewClient() (client Client, err error) {
288289 return defaultClient , nil
289290}
290291
292+ func NewWorkflowClient () (* workflow.Client , error ) {
293+ dclient , err := NewClient ()
294+ if err != nil {
295+ return nil , err
296+ }
297+
298+ return workflow .NewClient (dclient .GrpcClientConn ()), nil
299+ }
300+
291301// NewClientWithPort instantiates Dapr using specific gRPC port.
292302func NewClientWithPort (port string ) (client Client , err error ) {
293303 if port == "" {
Original file line number Diff line number Diff line change @@ -37,4 +37,4 @@ require (
3737 gopkg.in/yaml.v3 v3.0.1 // indirect
3838)
3939
40- replace github.com/dapr/durabletask-go => github.com/joshvanl/durabletask-go v0.0.0-20250910141618-db30df7b52d6
40+ replace github.com/dapr/durabletask-go => github.com/joshvanl/durabletask-go v0.0.0-20250910145333-8c0bbac241c3
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
3434github.com/google/go-cmp v0.7.0 /go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU =
3535github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0 =
3636github.com/google/uuid v1.6.0 /go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo =
37- github.com/joshvanl/durabletask-go v0.0.0-20250910141618-db30df7b52d6 h1:6jQhO49OJkcPrSd6muUU2KV2fsDh4OW3z0qB/TKmqJs =
38- github.com/joshvanl/durabletask-go v0.0.0-20250910141618-db30df7b52d6 /go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q =
37+ github.com/joshvanl/durabletask-go v0.0.0-20250910145333-8c0bbac241c3 h1:pJl5ptC8ovsxT5aMREpoP/CBpPj1KmmLj2+lUSJDBnw =
38+ github.com/joshvanl/durabletask-go v0.0.0-20250910145333-8c0bbac241c3 /go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q =
3939github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE =
4040github.com/kr/pretty v0.3.1 /go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk =
4141github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY =
Original file line number Diff line number Diff line change @@ -27,12 +27,10 @@ func main() {
2727 }
2828 fmt .Println ("Workflow(s) and activities registered." )
2929
30- dclient , err := client .NewClient ()
30+ wclient , err := client .NewWorkflowClient ()
3131 if err != nil {
3232 log .Fatal (err )
3333 }
34-
35- wclient := workflow .NewClient (dclient .GrpcClientConn ())
3634 fmt .Println ("Worker initialized" )
3735
3836 ctx , cancel := context .WithCancel (context .Background ())
Original file line number Diff line number Diff line change @@ -23,12 +23,10 @@ func main() {
2323 }
2424 fmt .Println ("Workflow(s) and activities registered." )
2525
26- dclient , err := client .NewClient ()
26+ wclient , err := client .NewWorkflowClient ()
2727 if err != nil {
2828 log .Fatal (err )
2929 }
30-
31- wclient := workflow .NewClient (dclient .GrpcClientConn ())
3230 fmt .Println ("Worker initialized" )
3331
3432 ctx , cancel := context .WithCancel (context .Background ())
Original file line number Diff line number Diff line change @@ -46,12 +46,10 @@ func main() {
4646 }
4747 fmt .Println ("FailActivity registered" )
4848
49- dclient , err := client .NewClient ()
49+ wclient , err := client .NewWorkflowClient ()
5050 if err != nil {
5151 log .Fatal (err )
5252 }
53-
54- wclient := workflow .NewClient (dclient .GrpcClientConn ())
5553 fmt .Println ("Worker initialized" )
5654
5755 ctx , cancel := context .WithCancel (context .Background ())
Original file line number Diff line number Diff line change @@ -31,4 +31,4 @@ require (
3131 google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
3232)
3333
34- replace github.com/dapr/durabletask-go => github.com/joshvanl/durabletask-go v0.0.0-20250910141618-db30df7b52d6
34+ replace github.com/dapr/durabletask-go => github.com/joshvanl/durabletask-go v0.0.0-20250910145333-8c0bbac241c3
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
2121github.com/google/go-cmp v0.7.0 /go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU =
2222github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0 =
2323github.com/google/uuid v1.6.0 /go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo =
24- github.com/joshvanl/durabletask-go v0.0.0-20250910141618-db30df7b52d6 h1:6jQhO49OJkcPrSd6muUU2KV2fsDh4OW3z0qB/TKmqJs =
25- github.com/joshvanl/durabletask-go v0.0.0-20250910141618-db30df7b52d6 /go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q =
24+ github.com/joshvanl/durabletask-go v0.0.0-20250910145333-8c0bbac241c3 h1:pJl5ptC8ovsxT5aMREpoP/CBpPj1KmmLj2+lUSJDBnw =
25+ github.com/joshvanl/durabletask-go v0.0.0-20250910145333-8c0bbac241c3 /go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q =
2626github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE =
2727github.com/kr/pretty v0.3.1 /go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk =
2828github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY =
You can’t perform that action at this time.
0 commit comments