You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
1 year ago | |
|---|---|---|
| .. | ||
| LINGYUN/Abp/Webhooks/EventBus | 3 years ago | |
| FodyWeavers.xml | 3 years ago | |
| FodyWeavers.xsd | 3 years ago | |
| LINGYUN.Abp.Webhooks.EventBus.csproj | 2 years ago | |
| README.EN.md | 1 year ago | |
| README.md | 1 year ago | |
README.md
LINGYUN.Abp.Webhooks.EventBus
Webhook事件总线集成模块,提供与ABP事件总线的集成支持。
功能特性
- 支持将Webhook事件发布到事件总线
- 与ABP事件总线无缝集成
- 支持分布式事件总线
模块引用
[DependsOn(typeof(AbpWebhooksEventBusModule))]
public class YouProjectModule : AbpModule
{
// other
}
基本用法
- 定义Webhook事件处理器
public class YourWebhookEventHandler :
IDistributedEventHandler<WebhookEventData>,
ITransientDependency
{
public async Task HandleEventAsync(WebhookEventData eventData)
{
// 处理webhook事件
}
}
- 发布Webhook事件
public class YourService
{
private readonly IDistributedEventBus _eventBus;
public YourService(IDistributedEventBus eventBus)
{
_eventBus = eventBus;
}
public async Task PublishWebhook()
{
await _eventBus.PublishAsync(new WebhookEventData
{
WebhookName = "YourWebhook",
Data = new { /* webhook data */ }
});
}
}