Esempio n. 1
0
 public static void RunCompoundWorker <TWorker>(RunCompoundWorkerParams runCompoundWorkerParams) where TWorker : class, IHostedService
 {
     ConfigureLogger.StandardSetup(logLevel: runCompoundWorkerParams.LogLevel);
     Host.CreateDefaultBuilder(runCompoundWorkerParams.Args)
     .UseSystemd()
     .ConfigureServices((hostContext, services) =>
     {
         runCompoundWorkerParams.IocDelegate(hostContext, null, services);
         services.AddSingleton(provider => runCompoundWorkerParams.WorkerProcess);
         services.AddSingleton(provider => runCompoundWorkerParams.ListenerInfo);
         services.AddSingleton(provider => runCompoundWorkerParams.IocDelegate);
         services.AddSingleton(provider => runCompoundWorkerParams.WebAppBuilderDelegate);
         services.AddHostedService <TWorker>();
     })
     .Build().Run();
 }
Esempio n. 2
0
 public static void RunCompoundWorker(RunCompoundWorkerParams runCompoundWorkerParams)
 {
     RunCompoundWorker <CompoundWorker>(runCompoundWorkerParams);
 }