Skip to content

Commit cc2abf7

Browse files
committed
Merge branch 'develop'
2 parents 2a96293 + 42ada11 commit cc2abf7

14 files changed

+14
-1693
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ matrix:
1313
dist: trusty
1414
env: SWIFT_SNAPSHOT_NAME="https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz"
1515
sudo: required
16+
- os: Linux
17+
dist: trusty
18+
env: SWIFT_SNAPSHOT_NAME="https://swift.org/builds/swift-4.2-branch/ubuntu1404/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-07-24-a/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-07-24-a-ubuntu14.04.tar.gz"
19+
sudo: required
1620
- os: osx
1721
osx_image: xcode9
1822
- os: osx
1923
osx_image: xcode9.3
24+
- os: osx
25+
osx_image: xcode9.4
2026

2127

2228
before_install:
@@ -31,4 +37,3 @@ script:
3137
- export PATH="${SWIFTENV_ROOT}/bin:${SWIFTENV_ROOT}/shims:$PATH"
3238
- swift build -c release
3339
- swift build -c debug
34-

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)