Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions content/develop/clients/go/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@ fmt.Printf("Model: %v, Brand: %v, Type: %v, Price: $%v\n",
// >>> Model: Deimos, Brand: Ergonom, Type: Enduro bikes, Price: $4972
```

Close the connection when you're done using `client.Close()`. In the
common case where you want to close the connection at the end of the
function where you opened it, you may find it convenient to use a `defer`
statement right after connecting:

```go
func main() {
client := redis.NewClient(&redis.Options{
...
})
defer client.Close()
...
}
```

## Observability

`go-redis` supports [OpenTelemetry](https://opentelemetry.io/) instrumentation.
Expand Down
3 changes: 2 additions & 1 deletion content/develop/clients/jedis/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ To include `Jedis` as a dependency in your application, edit the dependency file

## Connect and test

The following code opens a basic connection to a local Redis server:
The following code opens a basic connection to a local Redis server
and closes it after use.

```java
package org.example;
Expand Down
3 changes: 2 additions & 1 deletion content/develop/clients/lettuce/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ To build from source, see the instructions on the [Lettuce source code GitHub re
## Connect and test

Connect to a local server using the following code. This example
also stores and retrieves a simple string value to test the connection.
also stores and retrieves a simple string value to test the connection
and closes the connection after use.

```java
import io.lettuce.core.*;
Expand Down
6 changes: 6 additions & 0 deletions content/develop/clients/nodejs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ createClient({
```
To check if the client is connected and ready to send commands, use `client.isReady`, which returns a Boolean. `client.isOpen` is also available. This returns `true` when the client's underlying socket is open, and `false` when it isn't (for example, when the client is still connecting or reconnecting after a network error).

When you have finished using a connection, close it with `client.quit()`.

```js
await client.quit();
```

## More information

The [`node-redis` website](https://redis.js.org/) has more examples.
Expand Down
6 changes: 6 additions & 0 deletions content/develop/clients/redis-py/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ r.hgetall('user-session:123')
# {'surname': 'Smith', 'name': 'John', 'company': 'Redis', 'age': '29'}
```

Close the connection when you're done.

```python
r.close()
```

## More information

The [`redis-py`](https://redis.readthedocs.io/en/stable/index.html) website
Expand Down
Loading