retry

package
v0.0.0-...-48ffce4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2017 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteAsyncOperation

func ExecuteAsyncOperation(client management.Client, asyncOperation func() (management.OperationID, error), extraRules ...RetryRule) error

ExecuteAsyncOperation blocks until the provided asyncOperation is no longer in the InProgress state. Any known retryiable transient errors are retried and additional retry rules can be specified. If the operation was successful, nothing is returned, otherwise an error is returned.

func ExecuteOperation

func ExecuteOperation(syncOperation func() error, extraRules ...RetryRule) error

ExecuteOperation calls the provided syncOperation. Any known retryiable transient errors are retried and additional retry rules can be specified. If the operation was successful, nothing is returned, otherwise an error is returned.

Types

type RetryRule

type RetryRule func(management.AzureError) (bool, time.Duration)

RetryRule is a func (possibly with internal state to count retries) that determines if an AzureError should result in a retry and if so, what the back-off duration should be.

func ConstantBackoffRule

func ConstantBackoffRule(name string, match matchRule, backoff time.Duration, maxRetries int) RetryRule

func ExponentialBackoffRule

func ExponentialBackoffRule(name string, match matchRule, initialBackoff time.Duration, maximumBackoff time.Duration, maxRetries int) RetryRule

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL