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(); }
public static void RunCompoundWorker(RunCompoundWorkerParams runCompoundWorkerParams) { RunCompoundWorker <CompoundWorker>(runCompoundWorkerParams); }