| | 1 | | using System; |
| | 2 | | using System.Runtime.CompilerServices; |
| | 3 | | using Akka.Actor; |
| | 4 | | using Akka.Configuration; |
| | 5 | | using Microsoft.Extensions.DependencyInjection; |
| | 6 | |
|
| | 7 | | [assembly: InternalsVisibleTo("Mirero.Akka.Extensions.DependencyInjection.XUnit2")] |
| | 8 | |
|
| | 9 | | namespace Microsoft.Extensions.Hosting |
| | 10 | | { |
| | 11 | | public static class UseAkkaExtensions |
| | 12 | | { |
| | 13 | | public static IHostBuilder UseAkka(this IHostBuilder host, |
| | 14 | | string actorSystemName, |
| | 15 | | string hocon, |
| | 16 | | Func<Config, Config> hoconFunc, |
| | 17 | | Action<IServiceProvider, ActorSystem> startAction = null) => |
| 8 | 18 | | host.ConfigureServices((context, services) => |
| 16 | 19 | | services.AddAkka(actorSystemName, hocon, hoconFunc, startAction)); |
| | 20 | |
|
| | 21 | | public static IHostBuilder UseAkka(this IHostBuilder host, |
| | 22 | | string actorSystemName, |
| | 23 | | string hocon, |
| | 24 | | Action<IServiceProvider, ActorSystem> startAction = null) => |
| 4 | 25 | | host.UseAkka(actorSystemName, hocon, _ => _, startAction); |
| | 26 | | } |
| | 27 | | } |