mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-02 18:17:31 +08:00
chore: 🔨 事件发布器接口通道数量
[skip ci]
This commit is contained in:
@ -28,6 +28,9 @@ public sealed class DefaultEventPublisher : IEventPublisher
|
||||
}, App.EffectiveTypes.Where(x => typeof(IEventSubscriber).IsAssignableFrom(x) && x.IsClass && !x.IsAbstract).SelectMany(x => x.GetMethods(BindingFlags.Instance | BindingFlags.Public).Where(y => y.IsDefined(typeof(EventSubscribeAttribute)))).ToList());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public int ChannelCount => _eventChannel.Reader.Count;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task PublishAsync<T>(IEventData<T> eventData)
|
||||
{
|
||||
|
@ -5,6 +5,11 @@ namespace NetAdmin.Infrastructure.EventBus;
|
||||
/// </summary>
|
||||
public interface IEventPublisher
|
||||
{
|
||||
/// <summary>
|
||||
/// 通道数量
|
||||
/// </summary>
|
||||
int ChannelCount { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布一条消息
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user