-
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 ShardedDaemonProcess integration #463
Add ShardedDaemonProcess integration #463
Conversation
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.
LGTM - looks pretty clear to me
@@ -1011,6 +1011,69 @@ async Task Resolver(ActorSystem system, IActorRegistry registry, IDependencyReso | |||
registry.Register<TKey>(shardRegionProxy); | |||
}); | |||
} | |||
|
|||
public static AkkaConfigurationBuilder WithShardedDaemonProcess<TKey>( |
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.
LGTM - pretty straightforward
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.
Self review
builder.StartActors((system, registry) => | ||
{ | ||
try | ||
{ | ||
base.InitializeTest(system, (ActorSystemSetup)null!, null, null); | ||
_initialized.SetResult(Done.Instance); | ||
registry.Register<TestProbe>(TestActor); | ||
} | ||
catch (Exception e) | ||
{ | ||
_initialized.SetException(e); | ||
} | ||
}); | ||
|
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.
Need to move initialization to the start of the chain to make sure that we can inject TestActor
into test actor constructors
this AkkaConfigurationBuilder builder, | ||
string name, | ||
int numberOfInstances, | ||
Func<ActorSystem, IActorRegistry, IDependencyResolver, Func<int, Props>> entityPropsFactory, |
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.
Need to make the Props factory like this to support dependency injection
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.
LGTM
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.
lgtm
{ | ||
try | ||
{ | ||
base.InitializeTest(system, (ActorSystemSetup)null!, null, null); | ||
_initialized.SetResult(Done.Instance); | ||
registry.Register<TestProbe>(TestActor); |
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.
Ah, interesting
Changes