Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientModel: Make ClientRetryPolicy.Default a property instead of a field #41839

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/core/System.ClientModel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### Breaking Changes

- Change `HttpClientPipelineTransport.Shared` from a field to a property.
- Changed `HttpClientPipelineTransport.Shared` and `ClientRetryPolicy.Default` from static readonly fields to static properties.

### Bugs Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public virtual void Freeze() { }
}
public partial class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy
{
public static readonly System.ClientModel.Primitives.ClientRetryPolicy Default;
public ClientRetryPolicy(int maxRetries = 3) { }
public static System.ClientModel.Primitives.ClientRetryPolicy Default { get { throw null; } }
protected virtual System.TimeSpan GetNextDelay(System.ClientModel.Primitives.PipelineMessage message, int tryCount) { throw null; }
protected virtual void OnRequestSent(System.ClientModel.Primitives.PipelineMessage message) { }
protected virtual System.Threading.Tasks.ValueTask OnRequestSentAsync(System.ClientModel.Primitives.PipelineMessage message) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public virtual void Freeze() { }
}
public partial class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy
{
public static readonly System.ClientModel.Primitives.ClientRetryPolicy Default;
public ClientRetryPolicy(int maxRetries = 3) { }
public static System.ClientModel.Primitives.ClientRetryPolicy Default { get { throw null; } }
protected virtual System.TimeSpan GetNextDelay(System.ClientModel.Primitives.PipelineMessage message, int tryCount) { throw null; }
protected virtual void OnRequestSent(System.ClientModel.Primitives.PipelineMessage message) { }
protected virtual System.Threading.Tasks.ValueTask OnRequestSentAsync(System.ClientModel.Primitives.PipelineMessage message) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace System.ClientModel.Primitives;

public class ClientRetryPolicy : PipelinePolicy
{
public static readonly ClientRetryPolicy Default = new();
public static ClientRetryPolicy Default { get; } = new ClientRetryPolicy();

private const int DefaultMaxRetries = 3;
private static readonly TimeSpan DefaultInitialDelay = TimeSpan.FromSeconds(0.8);
Expand Down