2016-12-05 07:00:09 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
2016-11-17 16:33:27 +00:00
|
|
|
|
|
|
|
|
|
namespace Tapeti.Connection
|
2016-11-16 22:11:05 +00:00
|
|
|
|
{
|
|
|
|
|
public class TapetiPublisher : IPublisher
|
|
|
|
|
{
|
2016-12-05 07:00:09 +00:00
|
|
|
|
private readonly Func<TapetiWorker> workerFactory;
|
2016-11-16 22:11:05 +00:00
|
|
|
|
|
|
|
|
|
|
2016-12-05 07:00:09 +00:00
|
|
|
|
public TapetiPublisher(Func<TapetiWorker> workerFactory)
|
2016-11-16 22:11:05 +00:00
|
|
|
|
{
|
2016-12-05 07:00:09 +00:00
|
|
|
|
this.workerFactory = workerFactory;
|
2016-11-16 22:11:05 +00:00
|
|
|
|
}
|
2016-11-17 16:33:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Task Publish(object message)
|
|
|
|
|
{
|
2016-12-05 07:00:09 +00:00
|
|
|
|
return workerFactory().Publish(message);
|
2016-11-17 16:33:27 +00:00
|
|
|
|
}
|
2016-11-16 22:11:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|