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.8 KiB
1.8 KiB
LINGYUN.Abp.RealTime
Introduction
LINGYUN.Abp.RealTime is a real-time communication foundation module that provides infrastructure for real-time message delivery. This module is mainly used for handling real-time notifications, messages, and event delivery.
Features
- Real-time event delivery infrastructure
- Support for localized string handling
- Distributed event integration
- Extensible event handling mechanism
Installation
dotnet add package LINGYUN.Abp.RealTime
Usage
- Add
[DependsOn(typeof(AbpRealTimeModule))]to your module class.
[DependsOn(typeof(AbpRealTimeModule))]
public class YourModule : AbpModule
{
// ...
}
- Create real-time event data transfer object:
public class YourRealTimeEto : RealTimeEto<YourData>
{
public YourRealTimeEto(YourData data)
: base(data)
{
}
}
- Use localized strings:
public class LocalizedMessage
{
private readonly LocalizableStringInfo _localizableString;
public LocalizedMessage()
{
_localizableString = new LocalizableStringInfo(
"YourResource",
"MessageKey",
new Dictionary<object, object>
{
{ "param1", "value1" }
});
}
}
Advanced Usage
1. Custom Real-Time Events
[EventName("your-custom-event")]
public class CustomRealTimeEto : RealTimeEto<CustomData>
{
public CustomRealTimeEto(CustomData data)
: base(data)
{
}
}
2. Real-Time Event Handling
public class YourRealTimeEventHandler :
IDistributedEventHandler<YourRealTimeEto>,
ITransientDependency
{
public async Task HandleEventAsync(YourRealTimeEto eventData)
{
// Handle real-time event
}
}