-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to provide Actor TypeName during runtime at startup. #677
Milestone
Comments
I'd prefer approach 2 - the functions approach would be surprising, given that nothing else we do works that way. Feel free to send a PR for option 2 :) |
Must say I really like option one, would make it really straightforward to have the same set of "artifacts" flow and be reused through environments. |
bjorkstromm
added a commit
to bjorkstromm/dotnet-sdk
that referenced
this issue
May 16, 2021
3 tasks
3 tasks
bjorkstromm
added a commit
to bjorkstromm/dotnet-sdk
that referenced
this issue
Feb 9, 2022
- Fixes dapr#677 Signed-off-by: Martin Björkström <martin.bjorkstrom@gmail.com>
halspang
pushed a commit
that referenced
this issue
Feb 15, 2022
* Adds support for providing Actor type name during runtime. - Fixes #677 Signed-off-by: Martin Björkström <martin.bjorkstrom@gmail.com> * Make ActorTypeInformation.TryGet(Type) and ActorTypeInformation.Get(Type) obsolete. - Fix relevant code after obsoleting. Signed-off-by: Martin Björkström <martin.bjorkstrom@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the proposal
Currently, since Actor Placement Service is global within the Kubernetes cluster, it makes it difficult to run multiple versions (e.g. DEV and TEST) of the application within the same cluster. This is due to the fact that Actor names are either automatically assigned from the name of the implementing class or by using the
ActorAttribute
and specifying theTypeName
property. Bot of these approaches are compile-time constants which can't be adjusted during runtime.Here's two proposals:
Make it possible to resolve Actor TypeName from an environment variable when specified in the
ActorAttribute
. This is e.g. possible in Azure Functions with most of the attributes there. This would allow us to use the attribute as follows:The
%MyActorName%
can then be resolved from an environment variable using e.g. Environment.ExpandEnvironmentVariables, or using a more sophisticated approach as Azure Functions SDK (see NameResolverExtensions.cs).Make it possible to provide ActorTypeName when calling
RegisterActor<T>()
on theActorRegistrationCollection
. This would currently be possible ifActorTypeName
onActorTypeInformation
wasn't readonly. (I do it today using reflection :)). Propsal here is to add a overload toRegisterActor<T>()
which takes astring
parameter for the Actor TypeName.The text was updated successfully, but these errors were encountered: