Skip to content

Commit

Permalink
Consumer pause docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk committed Feb 17, 2025
1 parent 0e2e280 commit 5b4177f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/NATS.Client.JetStream/INatsJSContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ IAsyncEnumerable<string> ListConsumerNamesAsync(
/// <exception cref="NatsJSApiException">Server responded with an error.</exception>
/// <exception cref="ArgumentException">The <paramref name="stream"/> name is invalid.</exception>
/// <exception cref="ArgumentNullException">The <paramref name="stream"/> name is <c>null</c>.</exception>
/// <remarks>This feature is only available on NATS server v2.11 and later.</remarks>
ValueTask<ConsumerPauseResponse> PauseConsumerAsync(string stream, string consumer, DateTimeOffset pauseUntil, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -157,6 +158,7 @@ IAsyncEnumerable<string> ListConsumerNamesAsync(
/// <exception cref="NatsJSApiException">Server responded with an error.</exception>
/// <exception cref="ArgumentException">The <paramref name="stream"/> name is invalid.</exception>
/// <exception cref="ArgumentNullException">The <paramref name="stream"/> name is <c>null</c>.</exception>
/// <remarks>This feature is only available on NATS server v2.11 and later.</remarks>
ValueTask<bool> ResumeConsumerAsync(string stream, string consumer, CancellationToken cancellationToken = default);

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/NATS.Client.JetStream/Models/ConsumerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public ConsumerConfig(string name)
/// <summary>
/// If the consumer is paused, this contains until which time it is paused.
/// </summary>
/// <remarks>This feature is only available on NATS server v2.11 and later.</remarks>
[System.Text.Json.Serialization.JsonPropertyName("pause_until")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
public DateTimeOffset? PauseUntil { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions src/NATS.Client.JetStream/Models/ConsumerInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ public record ConsumerInfo
/// <summary>
/// Whether the consumer is paused.
/// </summary>
/// <remarks>This feature is only available on NATS server v2.11 and later.</remarks>
[System.Text.Json.Serialization.JsonPropertyName("paused")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
public bool IsPaused { get; set; }

/// <summary>
/// If the consumer is <see cref="IsPaused"/>, this contains how much time is remaining until this consumer is unpaused.
/// </summary>
/// <remarks>This feature is only available on NATS server v2.11 and later.</remarks>
[System.Text.Json.Serialization.JsonPropertyName("pause_remaining")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
[System.Text.Json.Serialization.JsonConverter(typeof(NatsJSJsonNullableNanosecondsConverter))]
Expand Down
1 change: 1 addition & 0 deletions src/NATS.Client.JetStream/Models/ConsumerPauseRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace NATS.Client.JetStream.Models;
/// <summary>
/// A request to the JetStream $JS.API.CONSUMER.PAUSE API
/// </summary>
/// <remarks>This feature is only available on NATS server v2.11 and later.</remarks>
internal record ConsumerPauseRequest
{
[System.Text.Json.Serialization.JsonPropertyName("pause_until")]
Expand Down

0 comments on commit 5b4177f

Please sign in to comment.