Skip to content

Releases: WallEnd/centrifuge-go

Change Backoff Strategy

17 Jul 06:14
785e83b
Compare
Choose a tag to compare

Backoff Strategy parameters was extracted to config, and default parameters was changed for slowing down reconnection actions and set max available reconnect iterations. Now we can change this parameters by modifying config on instance creation.
Now we have this config structure:

Config{
		BackoffReconnectConfig{
			NumReconnect:    DefaultBackoffNumReconnect,
			Factor:          DefaultBackoffFactor,
			Jitter:          DefaultBackoffJitter,
			MinMilliseconds: DefaultBackoffMinMilliseconds,
			MaxMilliseconds: DefaultBackoffMaxMilliseconds,
		},
		WsConfig{
			PingInterval:         DefaultPingInterval,
			ReadTimeout:          DefaultReadTimeout,
			WriteTimeout:         DefaultWriteTimeout,
			HandshakeTimeout:     DefaultHandshakeTimeout,
			PrivateChannelPrefix: DefaultPrivateChannelPrefix,
			Header:               http.Header{},
		},
}