MaxReconnects is an Option to set the maximum number of reconnect attempts. If negative, it will never stop trying to reconnect. Defaults to 60.
(max int)
| 1151 | // If negative, it will never stop trying to reconnect. |
| 1152 | // Defaults to 60. |
| 1153 | func MaxReconnects(max int) Option { |
| 1154 | return func(o *Options) error { |
| 1155 | o.MaxReconnect = max |
| 1156 | return nil |
| 1157 | } |
| 1158 | } |
| 1159 | |
| 1160 | // ReconnectJitter is an Option to set the upper bound of a random delay added ReconnectWait. |
| 1161 | // Defaults to 100ms and 1s, respectively. |
no outgoing calls