~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/ServiceStack/src/ServiceStack.Common/Messaging/InMemoryMessageQueueClient.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
 
 
3
namespace ServiceStack.Messaging
 
4
{
 
5
    public class InMemoryMessageQueueClient
 
6
        : IMessageQueueClient
 
7
    {
 
8
        private readonly MessageQueueClientFactory factory;
 
9
 
 
10
        public InMemoryMessageQueueClient(MessageQueueClientFactory factory)
 
11
        {
 
12
            this.factory = factory;
 
13
        }
 
14
 
 
15
        public void Publish<T>(T messageBody)
 
16
        {
 
17
            factory.PublishMessage(QueueNames<T>.In, new Message<T>(messageBody));
 
18
        }
 
19
 
 
20
        public void Publish<T>(IMessage<T> message)
 
21
        {
 
22
            factory.PublishMessage(QueueNames<T>.In, message);
 
23
        }
 
24
 
 
25
        public void Publish(string queueName, byte[] messageBytes)
 
26
        {
 
27
            factory.PublishMessage(queueName, messageBytes);
 
28
        }
 
29
 
 
30
        public void Notify(string queueName, byte[] messageBytes)
 
31
        {
 
32
            factory.PublishMessage(queueName, messageBytes);
 
33
        }
 
34
 
 
35
        public byte[] GetAsync(string queueName)
 
36
        {
 
37
            return factory.GetMessageAsync(queueName);
 
38
        }
 
39
 
 
40
        public string WaitForNotifyOnAny(params string[] channelNames)
 
41
        {
 
42
            throw new NotImplementedException();
 
43
        }
 
44
 
 
45
        public byte[] Get(string queueName, TimeSpan? timeOut)
 
46
        {
 
47
            throw new NotImplementedException();
 
48
        }
 
49
 
 
50
        public void Dispose()
 
51
        {
 
52
        }
 
53
    }
 
54
}
 
 
b'\\ No newline at end of file'