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
This package includes two modules: `NIORedis` and `Redis`, which provide clients that handle connection to, authorizing, and
3
-
executing commands against a Redis server.
1
+
# NIORedis: A Redis Driver built on SwiftNIO
4
2
5
-
`NIORedis` provides channel handlers for encoding / decoding between Swift native types and [Redis' Serialization Protocol (RESP)](https://redis.io/topics/protocol).
6
-
7
-
`Redis` is an abstraction layer that wraps `NIORedis` to be callback based with `DispatchQueue`.
8
-
9
-
# Motivation
10
-
Implementations of Redis connections have decayed as newer capabilities of the Swift STD Library, SwiftNIO, and the Swift language itself have developed.
11
-
12
-
As part of the iniative of trying to push the ecosystem to be centered around SwiftNIO, a framework-agnostic driver on Redis can provide an
13
-
easier time for feature development on Redis.
14
-
15
-
# Proposed Solution
16
-
A barebones implementation is available at [mordil/nio-redis](https://github.com/mordil/nio-redis).
17
-
18
-
The following are already implemented, with unit tests:
19
-
20
-
-[Connection and Authorization](https://github.com/Mordil/nio-redis/blob/master/Sources/NIORedis/NIORedis.swift#L35)
This package is a re-implementation of [vapor/redis](https://github.com/vapor/redis) stripped down to only build on SwiftNIO to be framework agnostic.
42
-
43
-
Much of this was inspired by the [NIOPostgres pitch](https://forums.swift.org/t/pitch-swiftnio-based-postgresql-client/18020).
44
-
45
-
# Details Solution
3
+
* Pitch discussion: [Swift Server Forums](https://forums.swift.org/t/swiftnio-redis-client/19325/13)
46
4
47
5
> **NOTE: This this is written against SwiftNIO 2.0, and as such requires Swift 5.0!**
48
6
49
-
This is to take advantage of the [`Result`](https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md) type in the `Redis` module,
7
+
This is to take advantage of the [`Result`](https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md) type in the `DispatchRedis` module,
50
8
and to stay ahead of development of the next version of SwiftNIO.
51
9
52
-
## NIORedis
53
-
Most use of this library will be focused on a `NIORedisConnection` type that works explicitly in a SwiftNIO `EventLoop` context - with
54
-
return values all being `EventLoopFuture`.
55
-
56
10
```swift
57
11
importNIORedis
58
12
59
13
let elg =MultiThreadedEventLoopGroup(numberOfThreads: 1)
0 commit comments