public static void AddDealyQueueService(this IServiceCollection services, string delayQueRedis) { DelayedRedisHelper.Initialization(new CSRedisClient(delayQueRedis)); services.AddSingleton(typeof(IDelayer <>), typeof(Delayer <>)); services.AddSingleton(typeof(IDelayedMessageProcessor <>), typeof(DelayedMessageProcessor <>)); services.AddMediatR(AppDomain.CurrentDomain.GetAssemblies()); }
public static void AddDealyQueueService(this IServiceCollection services, IConfiguration configuration) { DelayedRedisHelper.Initialization(new CSRedisClient(configuration.GetSection("DelayQueue:Redis").Value)); services.AddSingleton(typeof(IDelayer <>), typeof(Delayer <>)); services.AddSingleton(typeof(IDelayedMessageProcessor <>), typeof(DelayedMessageProcessor <>)); services.AddMediatR(AppDomain.CurrentDomain.GetAssemblies()); }