From 6e7559d3d3409d96545a8ee811caa0a9973bab9d Mon Sep 17 00:00:00 2001 From: cgcel Date: Thu, 11 Jan 2024 14:52:38 +0800 Subject: [PATCH] Rename RabbitSubscriberAsync and AddRabbitSubscriberAsync. --- Example/Example.MultiConsumers/Program.cs | 2 +- Example/Example.MultiConsumers/SecondConsumeService.cs | 6 +++--- Example/Example.NLog/ConsumeService.cs | 4 ++-- Example/Example.NLog/Program.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Example/Example.MultiConsumers/Program.cs b/Example/Example.MultiConsumers/Program.cs index 0bc30ed..cf62c67 100644 --- a/Example/Example.MultiConsumers/Program.cs +++ b/Example/Example.MultiConsumers/Program.cs @@ -41,7 +41,7 @@ // register BackgroundService builder.Services.AddRabbitSubscriber("FooFirstQueueConsumer", false); -builder.Services.AddRabbitSubscriberAsync("FooSecondQueueConsumer", false); +builder.Services.AddRabbitAsyncSubscriber("FooSecondQueueConsumer", false); using IHost host = builder.Build(); diff --git a/Example/Example.MultiConsumers/SecondConsumeService.cs b/Example/Example.MultiConsumers/SecondConsumeService.cs index c314530..c5e97c0 100644 --- a/Example/Example.MultiConsumers/SecondConsumeService.cs +++ b/Example/Example.MultiConsumers/SecondConsumeService.cs @@ -3,13 +3,13 @@ namespace Example.MultiConsumers; -public class SecondConsumeService : RabbitSubscriberAsync +public class SecondConsumeService : RabbitAsyncSubscriber { private readonly ILogger _logger; - public SecondConsumeService(IRabbitConsumer consumer, ILogger? logger, string consumerName, ILogger logger1) : base(consumer, consumerName, logger) + public SecondConsumeService(IRabbitConsumer consumer, string consumerName, ILogger? logger, ILogger logger2) : base(consumer, consumerName, logger) { - _logger = logger1; + _logger = logger2; } protected override Task HandleMessage(string message) diff --git a/Example/Example.NLog/ConsumeService.cs b/Example/Example.NLog/ConsumeService.cs index 1943a1e..21df357 100644 --- a/Example/Example.NLog/ConsumeService.cs +++ b/Example/Example.NLog/ConsumeService.cs @@ -3,11 +3,11 @@ namespace Example.NLog; -public class ConsumeService : RabbitSubscriberAsync +public class ConsumeService : RabbitAsyncSubscriber { private readonly ILogger? _logger; - public ConsumeService(IRabbitConsumer consumer, ILogger? logger, string consumerName, ILogger? logger2) : base(consumer, consumerName, logger) + public ConsumeService(IRabbitConsumer consumer, ILogger? logger, string consumerName, ILogger? logger2) : base(consumer, consumerName, logger) { _logger = logger2; } diff --git a/Example/Example.NLog/Program.cs b/Example/Example.NLog/Program.cs index 8dab2f5..ec0047d 100644 --- a/Example/Example.NLog/Program.cs +++ b/Example/Example.NLog/Program.cs @@ -98,5 +98,5 @@ IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) // register BackgroundService services.AddHostedService(); - services.AddRabbitSubscriberAsync("FooFirstQueueConsumer", false); + services.AddRabbitAsyncSubscriber("FooFirstQueueConsumer", false); }); \ No newline at end of file