2016-11-20 13:34:50 +00:00
|
|
|
|
using System;
|
|
|
|
|
using SimpleInjector;
|
|
|
|
|
using Tapeti;
|
2017-01-31 11:01:08 +00:00
|
|
|
|
using Tapeti.Flow;
|
2016-11-20 13:34:50 +00:00
|
|
|
|
using Tapeti.SimpleInjector;
|
|
|
|
|
|
|
|
|
|
namespace Test
|
|
|
|
|
{
|
|
|
|
|
internal class Program
|
|
|
|
|
{
|
|
|
|
|
private static void Main()
|
|
|
|
|
{
|
2017-02-07 15:13:33 +00:00
|
|
|
|
// TODO SQL based flow store
|
|
|
|
|
// TODO logging
|
|
|
|
|
|
2016-11-20 13:34:50 +00:00
|
|
|
|
var container = new Container();
|
2016-12-07 09:19:16 +00:00
|
|
|
|
container.Register<MarcoEmitter>();
|
2016-12-13 21:01:43 +00:00
|
|
|
|
container.Register<Visualizer>();
|
2016-12-07 09:19:16 +00:00
|
|
|
|
|
2017-02-07 17:22:28 +00:00
|
|
|
|
container.Register<IFlowRepository>();
|
|
|
|
|
|
2017-02-07 15:13:33 +00:00
|
|
|
|
var config = new TapetiConfig(new SimpleInjectorDependencyResolver(container))
|
2017-02-05 22:22:34 +00:00
|
|
|
|
.WithFlow()
|
2016-12-07 09:19:16 +00:00
|
|
|
|
.RegisterAllControllers()
|
|
|
|
|
.Build();
|
2016-11-20 13:34:50 +00:00
|
|
|
|
|
2017-02-05 22:22:34 +00:00
|
|
|
|
using (var connection = new TapetiConnection(config)
|
|
|
|
|
{
|
|
|
|
|
Params = new TapetiConnectionParams
|
|
|
|
|
{
|
|
|
|
|
HostName = "localhost",
|
|
|
|
|
PrefetchCount = 200
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
{
|
2016-11-20 13:34:50 +00:00
|
|
|
|
Console.WriteLine("Subscribing...");
|
|
|
|
|
connection.Subscribe().Wait();
|
|
|
|
|
Console.WriteLine("Done!");
|
|
|
|
|
|
2016-12-05 07:00:09 +00:00
|
|
|
|
var emitter = container.GetInstance<MarcoEmitter>();
|
|
|
|
|
emitter.Run().Wait();
|
2016-11-20 13:34:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|