Skip to content

Conversation

@zawadzkidiana
Copy link
Contributor

Add new_samples/common/cadence.go with NewCadenceClient() helper that handles all gRPC/YARPC setup in one function call.

Before: worker.go was ~100 lines with manual YARPC dispatcher setup
After: worker.go is ~40 lines focused on workflow/activity registration

Key changes:

  • common.NewCadenceClient() encapsulates all gRPC connection boilerplate
  • Removed explicit logger/scope setup (Cadence provides defaults)
  • Template updated to use the common helper

This is a stepping stone toward moving NewGrpcClient() to cadence-client itself (per Nathanael's proposal in Slack).

Add new_samples/common/cadence.go with NewCadenceClient() helper that
handles all gRPC/YARPC setup in one function call.

Before: worker.go was ~100 lines with manual YARPC dispatcher setup
After: worker.go is ~40 lines focused on workflow/activity registration

Key changes:
- common.NewCadenceClient() encapsulates all gRPC connection boilerplate
- Removed explicit logger/scope setup (Cadence provides defaults)
- Template updated to use the common helper

This is a stepping stone toward moving NewGrpcClient() to cadence-client
itself (per Nathanael's proposal in Slack).

Signed-off-by: Diana Zawadzki <[email protected]>
@zawadzkidiana zawadzkidiana force-pushed the simplify-worker-boilerplate branch from 0a5ed51 to 2a3a80c Compare December 3, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant