1
0
mirror of synced 2024-11-05 02:59:16 +00:00
Tapeti/Test/Program.cs

34 lines
921 B
C#
Raw Normal View History

using System;
using SimpleInjector;
using Tapeti;
using Tapeti.SimpleInjector;
namespace Test
{
internal class Program
{
private static void Main()
{
var container = new Container();
using (var connection = new TapetiConnection
{
PublishExchange = "test",
SubscribeExchange = "test"
}
.WithDependencyResolver(new SimpleInjectorDependencyResolver(container))
.RegisterAllControllers(typeof(Program).Assembly))
{
container.Register<MarcoEmitter>();
Console.WriteLine("Subscribing...");
connection.Subscribe().Wait();
Console.WriteLine("Done!");
var emitter = container.GetInstance<MarcoEmitter>();
emitter.Run().Wait();
}
}
}
}