You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
allow ability to inject constructor arguments when registering actor classes #977
actorRuntime.registerActor(SomeEntity.class); doesn't allow you to inject constructor arguments inside SomeEntity. Using getDeclaredConstructor().newInstance() or similar approach we should be able to allow constructor arguments whilst registering actor classes.
This is a design decision for all Dapr SDKs. It is because we implement virtual actors, when actors always exist, so it is never constructed. Instantiating a class in memory is just a representation of the virtual actor. Do you have an example of what you are trying to accomplish and we might see how it can be done with or without virtual actors.
Activity
artursouza commentedon Jan 4, 2024
This is a design decision for all Dapr SDKs. It is because we implement virtual actors, when actors always exist, so it is never constructed. Instantiating a class in memory is just a representation of the virtual actor. Do you have an example of what you are trying to accomplish and we might see how it can be done with or without virtual actors.
javier-aliaga commentedon Oct 15, 2026
you can use registerActor(Class, ActorFactory)