forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInMemoryMessageQueueClient.cs
More file actions
54 lines (44 loc) · 1.38 KB
/
InMemoryMessageQueueClient.cs
File metadata and controls
54 lines (44 loc) · 1.38 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
using System;
namespace ServiceStack.Messaging
{
public class InMemoryMessageQueueClient
: IMessageQueueClient
{
private readonly MessageQueueClientFactory factory;
public InMemoryMessageQueueClient(MessageQueueClientFactory factory)
{
this.factory = factory;
}
public void Publish<T>(T messageBody)
{
factory.PublishMessage(QueueNames<T>.In, new Message<T>(messageBody));
}
public void Publish<T>(IMessage<T> message)
{
factory.PublishMessage(QueueNames<T>.In, message);
}
public void Publish(string queueName, byte[] messageBytes)
{
factory.PublishMessage(queueName, messageBytes);
}
public void Notify(string queueName, byte[] messageBytes)
{
factory.PublishMessage(queueName, messageBytes);
}
public byte[] GetAsync(string queueName)
{
return factory.GetMessageAsync(queueName);
}
public string WaitForNotifyOnAny(params string[] channelNames)
{
throw new NotImplementedException();
}
public byte[] Get(string queueName, TimeSpan? timeOut)
{
throw new NotImplementedException();
}
public void Dispose()
{
}
}
}