Skip to content

Commit

Permalink
Oops - forgot about this class...
Browse files Browse the repository at this point in the history
  • Loading branch information
binarymash committed May 31, 2018
1 parent 9b24e7f commit 132da5f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Evelyn.Server.Host/EventStoreConnectionFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Evelyn.Server.Host
{
using System;
using EventStore.ClientAPI;
using Storage.EventStore;

public class EventStoreConnectionFactory : IEventStoreConnectionFactory
{
private readonly ConnectionSettings _connectionSettings;
private readonly Uri _uri;
private readonly string _connectionName;

public EventStoreConnectionFactory(string uri, string connectionName = "Evelyn.Server.Host")
{
_connectionSettings = ConnectionSettings.Create()
.EnableVerboseLogging()
.UseConsoleLogger()
.KeepReconnecting()
.Build();
_uri = new Uri(uri);
_connectionName = connectionName;
}

public IEventStoreConnection Invoke()
{
return EventStoreConnection.Create(_connectionSettings, _uri, _connectionName);
}
}
}

0 comments on commit 132da5f

Please sign in to comment.