You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/develop/clients/go/connect.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,3 +126,39 @@ if err != nil {
126
126
}
127
127
fmt.Println("foo", val)
128
128
```
129
+
130
+
## Connect using Seamless client experience (SCE)
131
+
132
+
*Seamless client experience (SCE)* is a feature of Redis Cloud and
133
+
Redis Enterprise servers that lets them actively notify clients
134
+
about planned server maintenance shortly before it happens. This
135
+
lets a client take action to avoid disruptions in service.
136
+
See [Seamless client experience]({{< relref "/develop/clients/sce" >}})
137
+
for more information about SCE.
138
+
139
+
To enable SCE on the client, add the `HitlessUpgrades` option during the
140
+
connection, as shown in the following example:
141
+
142
+
```go
143
+
rdb:= redis.NewClient(&redis.Options{
144
+
Addr: "localhost:6379",
145
+
Protocol: 3, // RESP3 required
146
+
HitlessUpgrades: &hitless.Config{
147
+
Mode: hitless.MaintNotificationsEnabled,
148
+
RelaxedTimeout: 10 * time.Second,
149
+
},
150
+
})
151
+
```
152
+
153
+
{{< note >}}SCE requires the [RESP3]({{< relref "/develop/reference/protocol-spec#resp-versions" >}})
154
+
protocol, so you must set `Protocol:3` explicitly when you connect.
155
+
{{< /note >}}
156
+
157
+
The `hitless.Config` object accepts the following parameters:
158
+
159
+
| Name | Description |
160
+
|------ |------------- |
161
+
|`Mode`| Whether or not to enable SCE. The options are `hitless.MaintNotificationsDisabled`, `hitless.MaintNotificationsEnabled` (require SCE and abort the connection if not supported), and `hitless.MaintNotificationsAuto` (require SCE and fall back to a non-SCE connection if not supported). The default is `hitless.MaintNotificationsAuto`. |
162
+
|`RelaxedTimeout`| The timeout to use for commands and connections while the server is performing maintenance. The default is 10 seconds. |
163
+
|`HandoffTimeout`| The timeout to connect to the replacement node. The default is 15 seconds. |
164
+
|`MaxHandoffRetries`| The maximum number of times to retry connecting to the replacement node. The default is 3. |
0 commit comments