Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.

Commit 4c5b7a6

Browse files
committed
Add a new Create method to EventStoreNodeConnection to support custom IEndPointDiscoverer
Fix typos in definitions
1 parent 652a093 commit 4c5b7a6

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

‎src/EventStore.ClientAPI.NetCore/EventStoreConnection.cs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,5 +213,19 @@ public static IEventStoreConnection Create(ConnectionSettings connectionSettings
213213

214214
return new EventStoreNodeConnection(connectionSettings, clusterSettings, endPointDiscoverer, connectionName);
215215
}
216+
217+
/// <summary>
218+
/// Creates a new <see cref="IEventStoreConnection"/> using specific <see cref="ConnectionSettings"/> and a custom-defined <see cref="IEndPointDiscoverer"/>
219+
/// </summary>
220+
/// <param name="connectionSettings">The <see cref="ConnectionSettings"/> to apply to the new connection</param>
221+
/// <param name="endPointDiscoverer">The custom-defined <see cref="IEndPointDiscoverer"/> to use for node discovery</param>
222+
/// <param name="connectionName">Optional name of connection (will be generated automatically, if not provided)</param>
223+
/// <returns>a new <see cref="IEventStoreConnection"/></returns>
224+
public static IEventStoreConnection Create(ConnectionSettings connectionSettings, IEndPointDiscoverer endPointDiscoverer, string connectionName = null)
225+
{
226+
Ensure.NotNull(connectionSettings, "settings");
227+
Ensure.NotNull(endPointDiscoverer, "endPointDiscoverer");
228+
return new EventStoreNodeConnection(connectionSettings, null, endPointDiscoverer, connectionName);
229+
}
216230
}
217231
}

‎src/EventStore.ClientAPI.NetCore/IEndPointDiscoverer.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
using System.Net;
22
using System.Threading.Tasks;
33

4-
namespace EventStore.ClientAPI
4+
namespace EventStore.ClientAPI
55
{
66
/// <summary>
7-
/// Represents a way of discovering cluster endpoints this could be through gossip, consul, text files, etc
7+
/// Represents a way of discovering cluster endpoints. This could be through gossip, consul, text files, etc
88
/// </summary>
99
public interface IEndPointDiscoverer
1010
{
1111
/// <summary>
1212
/// Called to discover a new <see cref="IPEndPoint"/>
1313
/// </summary>
14-
/// <param name="failedTcpEndPoint">The <see cref="IPEndPoint"/> The recently failed endpoint</param>
14+
/// <param name="failedTcpEndPoint">The <see cref="IPEndPoint"/>The recently failed endpoint</param>
1515
/// <returns></returns>
1616
Task<NodeEndPoints> DiscoverAsync(IPEndPoint failedTcpEndPoint);
1717
}

‎src/EventStore.ClientAPI.NetCore/NodeEndPoints.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ namespace EventStore.ClientAPI
99
public struct NodeEndPoints
1010
{
1111
/// <summary>
12-
/// The TCP endpoint of the node.
12+
/// The tcp endpoint of the node.
1313
/// </summary>
1414
public readonly IPEndPoint TcpEndPoint;
1515

1616
/// <summary>
17-
/// The ssh endpoint of the node.
17+
/// The ssl endpoint of the node.
1818
/// </summary>
1919
public readonly IPEndPoint SecureTcpEndPoint;
2020

@@ -31,7 +31,7 @@ public NodeEndPoints(IPEndPoint tcpEndPoint, IPEndPoint secureTcpEndPoint)
3131
}
3232

3333
/// <summary>
34-
/// Formats as a tring the endpoints
34+
/// Formats the endpoints as a string
3535
/// </summary>
3636
public override string ToString()
3737
{

0 commit comments

Comments
 (0)