-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathProgram.cs
More file actions
57 lines (54 loc) · 2.07 KB
/
Program.cs
File metadata and controls
57 lines (54 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using EventFlow;
using EventFlow.Aggregates;
using EventFlow.Configuration;
using EventFlow.EventStores;
using EventFlow.Extensions;
using EventFlow.Hangfire.Extensions;
using EventFlow.RabbitMQ;
using EventFlow.RabbitMQ.Integrations;
using EventFlow.Subscribers;
using EventFlowExample.Aggregates;
using EventFlowExample.Aggregates.Events;
using EventFlowExample.Jobs;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace SyncEventHandler
{
class Program
{
public static async Task Main(string[] args)
{
var builder = new HostBuilder()
.ConfigureAppConfiguration((host, config) =>
{
config.SetBasePath(Directory.GetCurrentDirectory());
})
.ConfigureServices(
(hostcontext, services) =>
{
EventFlowOptions.New
.UseHangfireJobScheduler()
.AddJobs(typeof(ExampleJob));
//.Configure(cfg => cfg.IsAsynchronousSubscribersEnabled = true)
//.PublishToRabbitMq(RabbitMqConfiguration.With(new Uri(@"amqp://test:test@localhost:5672"), true, 4, "eventflow"))
//.AddAsynchronousSubscriber<ExampleAggregate, WizloId, ExampleEvent, RabbitMqConsumePersistanceService>()
//.RegisterServices(s =>
//{
// s.Register<IHostedService, RabbitConsumePersistenceService>(Lifetime.Singleton);
// s.Register<IHostedService, RabbitMqConsumePersistanceService>(Lifetime.Singleton);
//});
})
.ConfigureLogging((hostingContext, logging) => { });
await builder.RunConsoleAsync();
Console.ReadLine();
}
}
}