-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support akka.actor.guardian-supervisor-strategy. #1525
Support akka.actor.guardian-supervisor-strategy. #1525
Conversation
I'm a little bit worried about |
I dont think this is a real problem as the old value was never used. |
if (supervisorStrategyType == null) | ||
{ | ||
// TODO: is it ok to throw exception here? | ||
throw new ArgumentException(string.Format("Type \"{0}\" is not found.", settings.SupervisorStrategyClass)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We throw Akka.ConfigurationException
if the source of the value is the HOCON config.
ArgumentException
is more of a user provided value.
There is also a third option here and use Type.GetType(settings.SupervisorStrategyClass,true)
Which will throw one of the following exceptions : https://msdn.microsoft.com/en-us/library/a87che9d(v=vs.110).aspx
I am leaning towards the latter as it would be the most idiomatic .NET way to deal with missing types
Thanks @rogeralsing for the remark. I've changed the code, you may review the updated version now. Type.GetType(settings.SupervisorStrategyClass, true, true) But it's up to you. |
@akoshelev there are also two missing tests in the ActorSystemSpec #60 about the supervisor strategy, maybe it would be make sense to include them in this PR? |
@Silv3rcircl3 Yep, I like the idea. Will do |
@Silv3rcircl3 @rogeralsing @Aaronontheweb I've got one problem with these tests. As I'm creating an actor system inside the test method, I'm not able to use |
@akoshelev so we can't apply the |
@Aaronontheweb Yes, you're right. public T ExpectOne<T>(Func<T> func)
{
return Intercept(func, _testkit.Sys, null, 1);
}
|
@akoshelev in that case, I guess we'll need to add an overload to the |
@Aaronontheweb Ok, I'll try to add this overload and will update this PR accordingly. |
Fixed issue #1524. LocalActorRefProvider now supports option 'akka.actor.guardian-supervisor-strategy'