WithRetryWait sets the retry wait time when ErrNoResponders is encountered. Defaults to 250ms.
(dur time.Duration)
| 675 | // WithRetryWait sets the retry wait time when ErrNoResponders is encountered. |
| 676 | // Defaults to 250ms. |
| 677 | func WithRetryWait(dur time.Duration) PublishOpt { |
| 678 | return func(opts *pubOpts) error { |
| 679 | if dur <= 0 { |
| 680 | return fmt.Errorf("%w: retry wait should be more than 0", ErrInvalidOption) |
| 681 | } |
| 682 | opts.retryWait = dur |
| 683 | return nil |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | // WithRetryAttempts sets the retry number of attempts when ErrNoResponders is |
| 688 | // encountered. Defaults to 2 |