forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIMessageHandler.cs
More file actions
37 lines (33 loc) · 1.2 KB
/
IMessageHandler.cs
File metadata and controls
37 lines (33 loc) · 1.2 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
32
33
34
35
36
37
using System;
namespace ServiceStack.Messaging
{
/// <summary>
/// Single threaded message handler that can process all messages
/// of a particular message type.
/// </summary>
public interface IMessageHandler
{
/// <summary>
/// The type of the message this handler processes
/// </summary>
Type MessageType { get; }
/// <summary>
/// Process all messages pending
/// </summary>
/// <param name="mqClient"></param>
void Process(IMessageQueueClient mqClient);
/// <summary>
/// Process messages from a single queue.
/// </summary>
/// <param name="mqClient"></param>
/// <param name="queueName">The queue to process</param>
/// <param name="doNext">A predicate on whether to continue processing the next message if any</param>
/// <returns></returns>
int ProcessQueue(IMessageQueueClient mqClient, string queueName, Func<bool> doNext = null);
/// <summary>
/// Get Current Stats for this Message Handler
/// </summary>
/// <returns></returns>
IMessageHandlerStats GetStats();
}
}