[Feature Request] Specify activity names at runtime
See original GitHub issueIs your feature request related to a problem? Please describe.
I have a need to create activities with names that aren’t known until runtime. The current design requires me to use [Activity(string)]
on a method or delegate, which only allows me to use activity names known at compile time.
As far as I can tell, there’s no simple way for me to add an ActivityAttribute
to a Delegate
at runtime in .NET, short of doing some kind of dynamic type generation (which seems like overkill).
Describe the solution you’d like
A simple solution would be to add a TemporalWorkerOptions.AddActivity(string name, Delegate del)
overload that allows me to specify the activity name explicitly.
Issue Analytics
- State:
- Created 7 months ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Allow setting the Activity properties after Activity creation ...
Allow setting the Activity properties after Activity creation and before starting it when using ActivitySource #42784.
Read more >Request runtime permissions
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >Introduction to activities
An Activity is an application component that provides a screen with ... is android:name, which specifies the class name of the activity.
Read more >Tutorial: Use feature flags in an ASP.NET Core app
In this tutorial, you learn how to implement feature flags in .NET Core apps.
Read more >Schemas, features, and examples - AWS Systems Manager
Schemas, features, and examples. AWS Systems Manager (SSM) documents use the following schema versions. Documents of type Command can use schema version 1.2 ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cgillum - I have already started on your first suggestion. I am right in the middle of workflow development on https://github.com/cretz/temporal-sdk-dotnet/tree/workflow-more-impl but I have exposed activity definition publicly already. But that code is a mess because it is mid development. Give me a little while longer and another alpha will be released with full workflow support (due to vacation and such, this may not be at least until the week of the 20th).
Also in the meantime, would love feedback on SDK approach/code in general. Though not quite yet on that branch 😃 May want to wait until the next workflow PR is up hopefully this week (will be merging #29 before I open the next one since I’m daisy-chaining for feedback reasons).
As for full impl of #27 and dynamic activity support, I need to wait until after I finish this development on workflows.
Yeah, this is effectively a general-purpose library for others to use, so the single activity approach unfortunately won’t work for me.
Thanks for opening the other issue - I’ll keep an eye on that.