Adjusting arguments and return value of retry function and adding new retry logic to stream

This commit is contained in:
Scott Finlay
2016-11-07 17:10:40 +01:00
parent 092d17a74e
commit a66bce0e4b
2 changed files with 12 additions and 5 deletions

View File

@@ -1,8 +1,10 @@
package client
type RetryFunc func(err error) bool
import "context"
type RetryFunc func(ctx context.Context, req Request, retryCount int, err error) (bool, error)
// always retry on error
func alwaysRetry(err error) bool {
return true
func alwaysRetry(ctx context.Context, req Request, retryCount int, err error) (bool, error) {
return true, err
}