Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
johannespfeiffer committed Oct 9, 2024
1 parent 526f09a commit 39beadc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/NATS.Client.Core/INatsConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ namespace NATS.Client.Core;

public interface INatsConnection : INatsClient
{
/// <summary>
/// Hook before TCP connection open.
/// </summary>
Func<(string Host, int Port), ValueTask<(string Host, int Port)>>? OnConnectingAsync { get; set; }

/// <summary>
/// Hook when socket is available.
/// </summary>
Func<ISocketConnection, ValueTask<ISocketConnection>>? OnSocketAvailableAsync { get; set; }

/// <summary>
/// Event that is raised when the connection to the NATS server is disconnected.
/// </summary>
Expand Down Expand Up @@ -61,6 +51,16 @@ public interface INatsConnection : INatsClient
/// </summary>
NatsHeaderParser HeaderParser { get; }

/// <summary>
/// Hook before TCP connection open.
/// </summary>
Func<(string Host, int Port), ValueTask<(string Host, int Port)>>? OnConnectingAsync { get; set; }

/// <summary>
/// Hook when socket is available.
/// </summary>
Func<ISocketConnection, ValueTask<ISocketConnection>>? OnSocketAvailableAsync { get; set; }

/// <summary>
/// Publishes a serializable message payload to the given subject name, optionally supplying a reply subject.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions tests/NATS.Client.JetStream.Tests/NatsJsContextFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ public class MockConnection : INatsConnection
public INatsSubscriptionManager SubscriptionManager { get; } = new TestSubscriptionManager();

public NatsHeaderParser HeaderParser { get; } = new NatsHeaderParser(Encoding.UTF8);

public Func<(string Host, int Port), ValueTask<(string Host, int Port)>>? OnConnectingAsync { get; set; }

public Func<ISocketConnection, ValueTask<ISocketConnection>>? OnSocketAvailableAsync { get; set; }

public ValueTask<TimeSpan> PingAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException();
Expand Down

0 comments on commit 39beadc

Please sign in to comment.