-
Notifications
You must be signed in to change notification settings - Fork 16
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
Comments
Does it need to be mocked? It's basically just some generics wrapped around a |
That works, although I’d have to test that an IActorRef was returned, however what I really wanted to do was test that the ActorRegistry was called correctly.
From: Aaron Stannard ***@***.***>
Sent: 07 April 2022 14:39
To: akkadotnet/Akka.Hosting ***@***.***>
Cc: Sean Farrow ***@***.***>; Author ***@***.***>
Subject: Re: [akkadotnet/Akka.Hosting] Add an interface for the ActorRegistry class (Issue #30)
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.
—
Reply to this email directly, view it on GitHub<#30 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALDK7SU733RZP6XMEKIXVDVD3QOFANCNFSM5SYGMBRA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
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? |
Why not register it? |
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.
From: Aaron Stannard ***@***.***>
Sent: 18 April 2022 17:28
To: akkadotnet/Akka.Hosting ***@***.***>
Cc: Sean Farrow ***@***.***>; Author ***@***.***>
Subject: Re: [akkadotnet/Akka.Hosting] Add an interface for the ActorRegistry class (Issue #30)
Why not register it?
—
Reply to this email directly, view it on GitHub<#30 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALDK7QGQIOCB3P6XDNR43LVFWERXANCNFSM5SYGMBRA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
closed via #42 |
I can still think of scenarios where it'd be useful to resolve the |
Agreed, there are definitely reasons for not using the registry, although this should definitely be encouraged.
Thanks,
Sean.
From: Aaron Stannard ***@***.***>
Sent: 21 April 2022 14:48
To: akkadotnet/Akka.Hosting ***@***.***>
Cc: Sean Farrow ***@***.***>; Author ***@***.***>
Subject: Re: [akkadotnet/Akka.Hosting] Add an interface for the ActorRegistry class (Issue #30)
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.
—
Reply to this email directly, view it on GitHub<#30 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALDK7TI7HBSTGLH5TE4X33VGFMCVANCNFSM5SYGMBRA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
It would be nice if the ActorRegistry derived from an non-Akka.Net interface, so that we could mock this when unit testing controllers.
The text was updated successfully, but these errors were encountered: