File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,13 @@ public static class BackgroundQueueRegistrar
12
12
/// <summary>
13
13
/// Tries to register a high-performance background Task/ValueTask queue (Singleton) as a HostedService
14
14
/// </summary>
15
- public static void AddBackgroundQueue ( this IServiceCollection services )
15
+ public static IServiceCollection AddBackgroundQueueAsSingleton ( this IServiceCollection services )
16
16
{
17
17
services . TryAddSingleton < IQueuedHostedService , QueuedHostedService > ( ) ;
18
18
services . AddHostedService ( svc => svc . GetService < IQueuedHostedService > ( ) ! ) ; // TODO: TryAdd for HostedService
19
19
services . TryAddSingleton < IBackgroundQueue , BackgroundQueue > ( ) ;
20
20
services . TryAddSingleton < IQueueInformationUtil , QueueInformationUtil > ( ) ;
21
+
22
+ return services ;
21
23
}
22
24
}
You can’t perform that action at this time.
0 commit comments