|
|
@@ -6,22 +6,22 @@ using Microsoft.Extensions.Logging; |
|
|
|
namespace DotNetCore.CAP |
|
|
|
{ |
|
|
|
/// <summary> |
|
|
|
/// Cap <see cref="ICapProducerService"/> default implement. |
|
|
|
/// Cap <see cref="ICapPublisher"/> default implement. |
|
|
|
/// </summary> |
|
|
|
public class DefaultProducerService : ICapProducerService |
|
|
|
public class DefaultCapPublisher : ICapPublisher |
|
|
|
{ |
|
|
|
private readonly ICapMessageStore _store; |
|
|
|
private readonly ILogger _logger; |
|
|
|
|
|
|
|
public DefaultProducerService( |
|
|
|
public DefaultCapPublisher( |
|
|
|
ICapMessageStore store, |
|
|
|
ILogger<DefaultProducerService> logger) |
|
|
|
ILogger<DefaultCapPublisher> logger) |
|
|
|
{ |
|
|
|
_store = store; |
|
|
|
_logger = logger; |
|
|
|
} |
|
|
|
|
|
|
|
public Task SendAsync(string topic, string content) |
|
|
|
public Task PublishAsync(string topic, string content) |
|
|
|
{ |
|
|
|
if (topic == null) throw new ArgumentNullException(nameof(topic)); |
|
|
|
if (content == null) throw new ArgumentNullException(nameof(content)); |
|
|
@@ -29,7 +29,7 @@ namespace DotNetCore.CAP |
|
|
|
return StoreMessage(topic, content); |
|
|
|
} |
|
|
|
|
|
|
|
public Task SendAsync<T>(string topic, T contentObj) |
|
|
|
public Task PublishAsync<T>(string topic, T contentObj) |
|
|
|
{ |
|
|
|
if (topic == null) throw new ArgumentNullException(nameof(topic)); |
|
|
|
|