temporalio / temporalio/samples-go

Add Sample for Typed equivalents for workflow.* functions/interfaces using generics

Open
#313 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
749
Forks
248
Avg merge
4d 2h
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.
Currently, there are a lot of interfaces and functions (e.g., side effects and channels) accepting or returning interface{}. I believe that with generics, it is possible to provide Typed equivalents for these interfaces, enhancing type safety.

Describe the solution you'd like
For instance, a side effect could take a typed function f and return f() directly instead of some converter.EncodedValue

func TypedSideEffect[T any](ctx Context, f func(ctx Context) T) (T, error)

Describe alternatives you've considered
Implement these typed interfaces in my own code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no target file, test, or specific workflow sample. Start by surveying the existing workflow samples and the Go SDK APIs that use interface{}; before coding, clarify which workflow.* functions or interfaces should receive typed equivalents and what sample coverage is expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend-api-design, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.