Extending generics for Workflow and Activity #353
wilsonehusin
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I had explored that as one of the options when generics came out: https://cschleiden.dev/blog/2022-03-06-go-workflows-generics
back then I did not want to adopt this since it felt too restrictive. Was hoping generics might evolve and provide better support for that scenario but that doesn't seem likely at this point. Maybe having two |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been toying around with the project and it makes me wonder if it's worth extending the generics usage to
ExecuteActivity
and its friends. By extending, I mean:This way, we can achieve compile-time type safety at the compromise of limiting activity argument to exactly one (excluding
context.Context
).In my experience using Temporal SDK, I've always ended up defaulting to make workflow and activity arguments as struct anyway to avoid friction around versioning, so this "restriction" is actually a plus in my book, encouraging better hygiene. Curious what you think!
Beta Was this translation helpful? Give feedback.
All reactions