1
0
mirror of synced 2024-11-16 14:53:50 +00:00
Tapeti/Connection/TapetiPublisher.cs

36 lines
849 B
C#
Raw Normal View History

using System;
using System.Threading.Tasks;
using RabbitMQ.Client;
2016-11-17 16:33:27 +00:00
namespace Tapeti.Connection
{
public class TapetiPublisher : IInternalPublisher
{
private readonly Func<TapetiWorker> workerFactory;
public TapetiPublisher(Func<TapetiWorker> workerFactory)
{
this.workerFactory = workerFactory;
}
2016-11-17 16:33:27 +00:00
public Task Publish(object message)
{
return workerFactory().Publish(message, null);
}
public Task Publish(object message, IBasicProperties properties)
{
return workerFactory().Publish(message, properties);
}
public Task PublishDirect(object message, string queueName, IBasicProperties properties)
{
return workerFactory().PublishDirect(message, queueName, properties);
2016-11-17 16:33:27 +00:00
}
}
}