Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
dec5817
Add schema and create_sdk_pull_requests to config
Jul 24, 2019
2a38f57
Add *.zip to .gitignore
Jul 24, 2019
317a7b7
Merge branch 'latest' of https://github.com/Azure/azure-sdk-for-go in…
Jul 25, 2019
23bc466
Generated from ca46ecf5c4baeb43c5fc1afb355c065bf49efd90 (#5449)
AutorestCI Aug 7, 2019
b04065c
Generated from b3623415bfb03b5a528c8a2a20caad53aba43ce2
AutorestCI Aug 1, 2019
0e470cf
Generated from f1354d954d03c2283656d3c820a88dcfc2ddf79e
AutorestCI Aug 2, 2019
7fed295
Generated from df3fa85139fca07f04373031470bed637e7b8126
AutorestCI Aug 5, 2019
3c08fc3
Merge pull request #4 from Azure/latest
pull[bot] Aug 7, 2019
802169b
[AutoPR preview/servicefabric/mgmt/2019-03-01-preview] Moving sfrp re…
openapi-sdkautomation[bot] Aug 7, 2019
81b98af
[AutoPR servicefabric/resource-manager] Moving sfrp release 2019-03-0…
AutorestCI Aug 7, 2019
3238545
Add schema and create_sdk_pull_requests to config
Jul 24, 2019
5f7b168
Merge branch 'sdkAutomationProdTest/preview/servicefabric/mgmt/2019-0…
Aug 8, 2019
2c3efaa
Add schema and create_sdk_pull_requests to config
Jul 24, 2019
144556d
Generated from b3623415bfb03b5a528c8a2a20caad53aba43ce2
AutorestCI Aug 1, 2019
593c204
Generated from f1354d954d03c2283656d3c820a88dcfc2ddf79e
AutorestCI Aug 2, 2019
6504683
Merge branch 'sdkAutomationProdTest/preview/servicefabric/mgmt/2019-0…
Aug 31, 2019
0c96f57
[AutoPR preview/servicefabric/mgmt/2019-03-01-preview] chore: jsonfmt…
openapi-sdkautomation[bot] Oct 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
73 changes: 13 additions & 60 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,25 @@ Changing one or more values will affect all subsequet API calls.
The default policy is to call `autorest.DoRetryForStatusCodes()` from an API's `Sender` method. Example:
```go
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
return autorest.SendWithSender(client, req, sd...)
}
```

Details on how `autorest.DoRetryforStatusCodes()` works can be found in the [documentation](https://godoc.org/github.com/Azure/go-autorest/autorest#DoRetryForStatusCodes).

It is not possible to change the invoked retry policy without writing a custom `Sender` and its calling code.
The slice of `SendDecorators` used in a `Sender` method can be customized per API call by smuggling them in the context. Here's an example.

```go
ctx := context.Background()
autorest.WithSendDecorators(ctx, []autorest.SendDecorator{
autorest.DoRetryForStatusCodesWithCap(client.RetryAttempts,
client.RetryDuration, time.Duration(0),
autorest.StatusCodesForRetry...)})
client.List(ctx)
```

This will replace the default slice of `SendDecorators` with the provided slice.

The `PollingDelay` and `PollingDuration` values are used exclusively by [WaitForCompletionRef()](https://godoc.org/github.com/Azure/go-autorest/autorest/azure#Future.WaitForCompletionRef) when blocking on an async call until it completes.

Expand Down
Loading