forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIMessageService.cs
More file actions
60 lines (51 loc) · 1.72 KB
/
Copy pathIMessageService.cs
File metadata and controls
60 lines (51 loc) · 1.72 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
namespace ServiceStack.Messaging
{
/// <summary>
/// Simple definition of an MQ Host
/// </summary>
public interface IMessageService
: IDisposable
{
/// <summary>
/// Factory to create consumers and producers that work with this service
/// </summary>
IMessageFactory MessageFactory { get; }
/// <summary>
/// Register DTOs and hanlders the MQ Host will process
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="processMessageFn"></param>
void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn);
/// <summary>
/// Register DTOs and hanlders the MQ Host will process
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="processMessageFn"></param>
/// <param name="processExceptionEx"></param>
void RegisterHandler<T>(Func<IMessage<T>, object> processMessageFn, Action<IMessage<T>, Exception> processExceptionEx);
/// <summary>
/// Get Total Current Stats for all Message Handlers
/// </summary>
/// <returns></returns>
IMessageHandlerStats GetStats();
/// <summary>
/// Get the status of the service. Potential Statuses: Disposed, Stopped, Stopping, Starting, Started
/// </summary>
/// <returns></returns>
string GetStatus();
/// <summary>
/// Get a Stats dump
/// </summary>
/// <returns></returns>
string GetStatsDescription();
/// <summary>
/// Start the MQ Host if not already started.
/// </summary>
void Start();
/// <summary>
/// Stop the MQ Host if not already stopped.
/// </summary>
void Stop();
}
}