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

Add an interface for the ActorRegistry class #30

Closed
SeanFarrow opened this issue Apr 7, 2022 · 8 comments
Closed

Add an interface for the ActorRegistry class #30

SeanFarrow opened this issue Apr 7, 2022 · 8 comments
Milestone

Comments

@SeanFarrow
Copy link
Contributor

It would be nice if the ActorRegistry derived from an non-Akka.Net interface, so that we could mock this when unit testing controllers.

@Aaronontheweb
Copy link
Member

Does it need to be mocked? It's basically just some generics wrapped around a ConcurrentDictionary - and I think the ActorRegistry constructor is public and parameterless, so it should be easy to create a new instance of it on the fly for unit testing purposes.

@SeanFarrow
Copy link
Contributor Author

SeanFarrow commented Apr 7, 2022 via email

@SeanFarrow
Copy link
Contributor Author

OK, this is now done, so I will raise a PR in the next few days.

The only thing I was wondering, was why the actor system is being registered?

Unless I'm missing something, the whole idea is that the actor registry is used to retrieve actors at runtime. Given the actor system is created and then passed to the actor registry, does the actor system really need to be registered at all?

@Aaronontheweb
Copy link
Member

Why not register it?

@SeanFarrow
Copy link
Contributor Author

SeanFarrow commented Apr 18, 2022 via email

@Aaronontheweb
Copy link
Member

closed via #42

@Aaronontheweb
Copy link
Member

The only reason I wouldn’t register it is users not falling in to the ‘pit of success’ in terms of using the actor registry rather than the actor system itself.

I can still think of scenarios where it'd be useful to resolve the ActorSystem directly, such as scenarios where each request requires a dynamic "unit of work" actor managing a saga et al. I get your point though but I don't want to be too opinionated.

@SeanFarrow
Copy link
Contributor Author

SeanFarrow commented Apr 21, 2022 via email

@Aaronontheweb Aaronontheweb added this to the 0.3.0 milestone May 19, 2022
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