1
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
using System.Threading.Channels;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务消息通知
|
||||
/// </summary>
|
||||
public class TaskMesageNotify : ITaskMessageNotify
|
||||
{
|
||||
private readonly Channel<NotifyMessage> _channel = Channel.CreateUnbounded<NotifyMessage>();
|
||||
|
||||
public ChannelReader<NotifyMessage> Reader => _channel.Reader;
|
||||
public ChannelWriter<NotifyMessage> Writer => _channel.Writer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//public static class TaskMesageNotify
|
||||
//{
|
||||
// private static readonly Channel<string> _channel = Channel.CreateUnbounded<string>();
|
||||
|
||||
|
||||
// public static ChannelReader<string> Reader => _channel.Reader;
|
||||
// public static ChannelWriter<string> Writer => _channel.Writer;
|
||||
|
||||
|
||||
//}
|
||||
|
||||
public static class TaskMessageNotifyExtensions
|
||||
{
|
||||
public static IServiceCollection AddTaskMessageNotify(this IServiceCollection services)
|
||||
{
|
||||
_ = services.AddSingleton<ITaskMessageNotify, TaskMesageNotify>();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user