Skip to content

Commit a6d7e2f

Browse files
authored
Update README.md
Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
1 parent ac45bb2 commit a6d7e2f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@ A Swift client library for Valkey.
44

55
## Usage
66

7-
The valkey-swift project uses a connection pool, which requires a background process to manage it. You can either run it using a Task group
7+
The valkey-swift project uses a connection pool, which requires a background process to manage it. You can either run it using a TaskGroup or async let. Below we are using async let to run the connection pool background process.
88

99
```swift
1010
let valkeyClient = ValkeyClient(.hostname("localhost", port: 6379), logger: logger)
11-
try await withThrowingTaskGroup(of: Void.self) { group in
12-
group.addTask {
13-
// run connection pool in the background
14-
await valkeyClient.run()
15-
}
16-
// use valkey client
17-
}
11+
async let _ = valkeyClient.run()
12+
// use valkey client
1813
```
1914

2015
Or you can use ValkeyClient with [swift-service-lifecycle](https://github.com/swift-server/swift-service-lifecycle).

0 commit comments

Comments
 (0)