Skip to content
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

allow ability to inject constructor arguments when registering actor classes #977

Open
hadeed85 opened this issue Dec 16, 2023 · 1 comment

Comments

@hadeed85
Copy link

hadeed85 commented Dec 16, 2023

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.

@artursouza
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants