【文件属性】:
文件名称:EventBus
文件大小:18KB
文件格式:ZIP
更新时间:2021-03-08 03:26:50
C#
事件总线
使用RabbitMq的简单事件总线。
所有事件都应继承自IntegrativeEvent。 您可以使用唯一的ID(即Guid)跟踪日志中的事件。
public class TestIE : IntegrativeEvent
{
public string Name { get; set; }
}
使用IMessagePublisher来发布消息:
public class ExampleClass
{
private readonly IMessagePublisher _publisher;
public ExampleClass(IMessagePublisher publisher)
{
_publisher = publisher;
}
public async Task Publish()
{
var @event = new TestIE
【文件预览】:
EventBus-master
----EventBus.sln(3KB)
----test()
--------EventBus.RabbitMq.IntegrationTests()
--------EventBus.RabbitMq.UnitTests()
----src()
--------EventBus.RabbitMq()
----.gitignore(6KB)
----README.md(2KB)
----.gitattributes(2KB)