mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-04-20 05:02:50 +08:00
chore: 🔨 事件发布器接口通道数量
[skip ci]
This commit is contained in:
parent
4afda0fbde
commit
6fed7ec752
@ -23,7 +23,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.6.0.109712">
|
||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.7.0.110445">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user