Nathan Harris e446a834cd Namespace global static factory methods under Redis
Motivation:

The two provided factory methods for creating `RedisConnection` and `ClientBootstrap` were not readily discoverable or appropriately expressible.

Modifications:

- Add: `Redis` top-level namespace enum
- Move & Rename: `RedisConnection.connect` factory method to `Redis.makeConnection`
- Move & Rename: `ClientBootstrap.makeRedisDefault` factory method to `Redis.makeDefaultClientBootstrap`
- Rename: `EventLoopFuture` extension file to just `SwiftNIO` to have all framework extensions in a single file

Results:

Using NIORedis should be more discoverable and straight forward on how to create a connection with `Redis.makeConnection(...)` over `RedisConnection.connect(...)`
2019-04-30 21:01:35 -07:00
2018-12-13 13:34:30 -08:00
2019-02-12 22:44:04 -08:00
2019-01-08 15:14:19 -08:00
2019-02-08 00:16:58 -08:00

License Build Swift Redis

NIORedis

A non-blocking Swift driver for Redis built with SwiftNIO.

This package defines everything you need to work with Redis through the Redis Seralization Protocol (RESP).

Installation

To install NIORedis, just add the package as a dependency in your Package.swift

dependencies: [
    .package(url: "https://github.com/Mordil/nio-redis.git", .upToNextMinor(from: "0.2.0")
]

and run the following command: swift package resolve

Getting Started

NIORedis is ready to use right after installation.

import NIORedis

let driver = NIORedisDriver(ownershipModel: .internal(threadCount: 2))

let connection = try driver.makeConnection().wait()

let result = try connection.set("my_key", to: "some value")
    .flatMap { return connection.get("my_key" }
    .wait()

print(result) // Optional("some value")

Contributing

Check out CONTRIBUTING.md for more information on how to help with NIORedis.

It is highly recommended to use Docker to install Redis locally.

docker run -d -p 6379:6379 --name nioredis redis:5

Otherwise, install Redis directly on your machine from Redis.io.

S
Description
Non-blocking, event-driven Swift client for Redis.
Readme
1.9 MiB
Languages
Swift 99.7%
Shell 0.3%