question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Specify activity names at runtime

See original GitHub issue

Is 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:closed
  • Created 7 months ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cretzcommented, Mar 6, 2023

@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.

1reaction
cgillumcommented, Mar 1, 2023

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found