Skip to content

Commit

Permalink
ClientModel: Make ClientRetryPolicy.Default a property instead of a f…
Browse files Browse the repository at this point in the history
…ield (#41839)

* Make ClientRetryPolicy.Default a static property instead of a field

* CHANGELOG

* pr fb
  • Loading branch information
annelo-msft authored Feb 14, 2024
1 parent 99551c7 commit e4682df
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
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

0 comments on commit e4682df

Please sign in to comment.