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

46 lines
1.2 KiB
C#
Raw Normal View History

using System;
using SimpleInjector;
using Tapeti;
using Tapeti.Flow;
using Tapeti.SimpleInjector;
namespace Test
{
internal class Program
{
private static void Main()
{
// TODO SQL based flow store
// TODO logging
var container = new Container();
2016-12-07 09:19:16 +00:00
container.Register<MarcoEmitter>();
container.Register<Visualizer>();
2016-12-07 09:19:16 +00:00
container.Register<IFlowRepository>();
var config = new TapetiConfig(new SimpleInjectorDependencyResolver(container))
.WithFlow()
2016-12-07 09:19:16 +00:00
.RegisterAllControllers()
.Build();
using (var connection = new TapetiConnection(config)
{
Params = new TapetiConnectionParams
{
HostName = "localhost",
PrefetchCount = 200
}
})
{
Console.WriteLine("Subscribing...");
connection.Subscribe().Wait();
Console.WriteLine("Done!");
var emitter = container.GetInstance<MarcoEmitter>();
emitter.Run().Wait();
}
}
}
}