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
A non-blocking Swift client for Redis built on top of SwiftNIO.
4
+
5
+
## Overview
6
+
7
+
**RediStack** is quick to use - all you need is an [`EventLoop`](https://apple.github.io/swift-nio/docs/current/NIO/Protocols/EventLoop.html) from **SwiftNIO**.
8
+
9
+
```swift
10
+
importNIO
11
+
importRediStack
12
+
13
+
let eventLoop: EventLoop =...
14
+
let connection = RedisConnection.make(
15
+
configuration: try .init(hostname: "127.0.0.1"),
16
+
boundEventLoop: eventLoop
17
+
).wait()
18
+
19
+
let result =try connection.set("my_key", to: "some value")
20
+
.flatMap { return connection.get("my_key") }
21
+
.wait()
22
+
23
+
print(result) // Optional("some value")
24
+
```
25
+
26
+
> Important: Use of `wait()` was used here for simplicity. Never call this method on an `eventLoop`!
0 commit comments