-
Notifications
You must be signed in to change notification settings - Fork 17
make AkkaHostedService public
+ virtual
#306
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
make AkkaHostedService public
+ virtual
#306
Conversation
Re-implementation of akkadotnet#299 Made clear in XML-DOC comment, this is a "there be dragons" use case for end-users. We're not going to provide you with much support beyond making this possible. Best of luck.
private readonly AkkaConfigurationBuilder _configurationBuilder; | ||
private readonly IHostApplicationLifetime? _hostApplicationLifetime; | ||
private readonly ILogger<AkkaHostedService> _logger; | ||
protected ActorSystem? ActorSystem; |
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.
Made all of these accessible in derivative classes.
@@ -11,36 +12,42 @@ namespace Akka.Hosting | |||
/// <summary> | |||
/// INTERNAL API | |||
/// </summary> | |||
internal sealed class AkkaHostedService : IHostedService | |||
/// <remarks> | |||
/// Open for modification in cases where users need fine-grained control over <see cref="Actor.ActorSystem"/> startup and |
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.
Warning to users: there will be tears if you don't study our source code when you try to extend this, and we will not help you with whatever weird DI stuff you're trying to do. Best of luck.
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, small nitpick.
@@ -77,6 +77,34 @@ public static IServiceCollection AddAkka(this IServiceCollection services, strin | |||
|
|||
return services; | |||
} | |||
|
|||
public static IServiceCollection AddAkka<T>(this IServiceCollection services, string actorSystemName, Action<AkkaConfigurationBuilder, IServiceProvider> builder) where T:AkkaHostedService |
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.
Since the generic code is identical to the non-generic one, we should just call the generic one from inside the non-generic extension method. Saves us the time to have to check that both implementation are the same in the future.
Fixes #298
Changes
Re-implementation of #299 - no abstract base classes, just made the main one public + virtual in order to keep things simple for Akka.Hosting.Maui et
Made clear in XML-DOC comment, this is a "there be dragons" use case for end-users. We're not going to provide you with much support beyond making this possible. Best of luck.
Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):