-
-
Notifications
You must be signed in to change notification settings - Fork 630
Expand file tree
/
Copy pathIMQService.cs
More file actions
31 lines (27 loc) · 1.22 KB
/
IMQService.cs
File metadata and controls
31 lines (27 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using BotSharp.Abstraction.Infrastructures.MessageQueues.Models;
namespace BotSharp.Abstraction.Infrastructures.MessageQueues;
public interface IMQService : IDisposable
{
/// <summary>
/// Subscribe a consumer to the message queue.
/// The consumer will be initialized with the appropriate MQ-specific infrastructure.
/// </summary>
/// <param name="key">Unique identifier for the consumer</param>
/// <param name="consumer">The consumer implementing IMQConsumer interface</param>
/// <returns>Task<bool> representing the async subscription operation</returns>
Task<bool> SubscribeAsync(string key, IMQConsumer consumer);
/// <summary>
/// Unsubscribe a consumer from the message queue.
/// </summary>
/// <param name="key">Unique identifier for the consumer</param>
/// <returns>Task<bool> representing the async unsubscription operation</returns>
Task<bool> UnsubscribeAsync(string key);
/// <summary>
/// Publish payload to message queue
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="payload"></param>
/// <param name="options"></param>
/// <returns></returns>
Task<bool> PublishAsync<T>(T payload, MQPublishOptions options);
}