2016-11-16 22:11:05 +00:00
|
|
|
|
using System.Collections.Generic;
|
2016-11-17 16:33:27 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2016-11-16 22:11:05 +00:00
|
|
|
|
|
|
|
|
|
namespace Tapeti.Connection
|
|
|
|
|
{
|
|
|
|
|
public class TapetiSubscriber : ISubscriber
|
|
|
|
|
{
|
|
|
|
|
private readonly TapetiWorker worker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TapetiSubscriber(TapetiWorker worker, IEnumerable<IMessageHandlerRegistration> registrations)
|
|
|
|
|
{
|
|
|
|
|
this.worker = worker;
|
|
|
|
|
|
|
|
|
|
ApplyTopology(registrations);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void ApplyTopology(IEnumerable<IMessageHandlerRegistration> registrations)
|
|
|
|
|
{
|
|
|
|
|
foreach (var registration in registrations)
|
2016-11-17 16:33:27 +00:00
|
|
|
|
worker.ApplyTopology(registration);
|
2016-11-16 22:11:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|