1
0
mirror of synced 2024-11-05 02:59:16 +00:00
Tapeti/Test/Program.cs
2016-12-07 10:19:16 +01:00

36 lines
954 B
C#

using System;
using SimpleInjector;
using Tapeti;
using Tapeti.SimpleInjector;
namespace Test
{
internal class Program
{
private static void Main()
{
var container = new Container();
container.Register<MarcoEmitter>();
var topology = new TapetiTopologyBuilder()
.RegisterAllControllers()
.Build();
using (var connection = new TapetiConnectionBuilder()
.SetExchange("test")
.SetDependencyResolver(new SimpleInjectorDependencyResolver(container))
.SetTopology(topology)
.Build())
{
Console.WriteLine("Subscribing...");
connection.Subscribe().Wait();
Console.WriteLine("Done!");
var emitter = container.GetInstance<MarcoEmitter>();
emitter.Run().Wait();
}
}
}
}