Skip to content

Commit 60cc0fe

Browse files
committed
Drop Redis client
This module is going to be just the plain NIO Redis protocol implementation. The "opinionated" client is dropped from the module. Get it over at Noze.io.
1 parent c3720e2 commit 60cc0fe

13 files changed

+8
-1692
lines changed

Package.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ let package = Package(
66
name: "swift-nio-redis",
77
products: [
88
.library (name: "NIORedis", targets: [ "NIORedis" ]),
9-
.library (name: "Redis", targets: [ "Redis" ]),
109
],
1110
dependencies: [
1211
.package(url: "https://github.com/apple/swift-nio.git",
1312
from: "1.8.0"),
1413
],
1514
targets: [
16-
.target(name: "NIORedis", dependencies: [ "NIO", "NIOFoundationCompat" ]),
17-
.target(name: "Redis", dependencies: [ "NIORedis" ]),
18-
.testTarget(name: "NIORedisTests", dependencies: [ "NIORedis"]),
19-
.testTarget(name: "RedisTests", dependencies: [ "Redis"]),
15+
.target(name: "NIORedis",
16+
dependencies: [ "NIO", "NIOFoundationCompat" ]),
17+
.testTarget(name: "NIORedisTests", dependencies: [ "NIORedis"])
2018
]
2119
)

README.md

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ or it can be used as a relay to implement a chat server using its builtin
2626
[PubSub](https://redis.io/topics/pubsub)
2727
features.
2828

29-
This Swift package includes the RESP protocol implementation and a simple
30-
Redis client.
29+
This Swift package includes the RESP protocol implementation.
30+
A simple Redis client can be found on
31+
[swift-nio-redis-client](https://github.com/NozeIO/swift-nio-redis-client).
3132
We also provide an actual [Redis Server](https://github.com/NozeIO/redi-s)
3233
written in Swift, using SwiftNIO and SwiftNIO Redis.
3334

@@ -53,14 +54,12 @@ import PackageDescription
5354
let package = Package(
5455
name: "RedisTests",
5556
dependencies: [
56-
.package(url: "https://github.com/NozeIO/swift-nio-redis.git",
57+
.package(url: "https://github.com/SwiftNIOExtras/swift-nio-redis.git",
5758
from: "0.8.0")
5859
],
5960
targets: [
6061
.target(name: "MyProtocolTool",
61-
dependencies: [ "NIORedis" ]),
62-
.target(name: "MyClientTool",
63-
dependencies: [ "Redis" ])
62+
dependencies: [ "NIORedis" ])
6463
]
6564
)
6665
```
@@ -92,62 +91,13 @@ bootstrap.channelInitializer { channel in
9291
```
9392

9493

95-
## Using the Redis client module
96-
97-
The
98-
[Redis](Sources/Redis/README.md)
99-
client module is modeled after the Node.js
100-
[node_redis](https://github.com/NodeRedis/node_redis)
101-
module,
102-
but it also supports NIO like Promise/Future based methods in addition
103-
to the Node.js `(err,result)` style callbacks. Choose your poison.
104-
105-
### Simple KVS use example:
106-
107-
```swift
108-
import Redis
109-
110-
let client = Redis.createClient()
111-
112-
client.set ("counter", 0, expire: 2)
113-
client.incr("counter", by: 10)
114-
client.get ("counter") { err, value in
115-
print("Reply:", value)
116-
}
117-
client.keys("*") { err, reply in
118-
guard let keys = reply else { return print("got no keys!") }
119-
print("all keys in store:", keys.joined(separator: ","))
120-
}
121-
```
122-
123-
Using NIO Promises:
124-
125-
```swift
126-
client
127-
.set ("counter", 0, expire: 2)
128-
.then {
129-
client.incr("counter", by: 10)
130-
}
131-
.then {
132-
client.get("counter")
133-
}
134-
.map {
135-
print("counter is:", $0)
136-
}
137-
```
138-
139-
14094
## Status
14195

14296
The
14397
[protocol implementation](Sources/NIORedis/)
14498
is considered complete. There are a few open ends
14599
in the `telnet` variant, yet the regular binary protocol is considered done.
146100

147-
The
148-
[Redis client module](Sources/Redis/)
149-
has a few more open ends, but seems to work fine.
150-
151101

152102
### Who
153103

Sources/Redis/README.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)