Nathan Harris 0131fe43ba Update Readme and Tweak Redis.makeConnection(...)
Motivation:

The goal of the `Redis.makeConnection` factory method is to provide end users with a quick way to jump in and get started with Redis in Swift.

Right now, users have to provide an `EventLoopGroup` instance, when a reasonable default is available for us to define.

Modifications:

- Add: `MultiThreadedEventLoopGroup` for 1 thread as a default argument to the `using:` label in `Redis.makeConnection`
- Remove: The `with:` label for the password in `Redis.makeConnection`
- Change: The project README to reflect the current state of the project

Results:

Users should be able to create `RedisConnections` by just defining an IP Address & Port to connect to - and possibly a password.

In addition, the README should now properly direct users on how to use the latest version of the library.
2019-05-01 18:59:59 -07:00
2018-12-13 13:34:30 -08:00
2019-02-12 22:44:04 -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.7.0")
]

and run the following command: swift package resolve

Getting Started

NIORedis is ready to use right after installation.

import NIORedis

let connection = Redis.makeConnection(
    to: try .init(ipAddress: "127.0.0.1", port: 6379),
    password: "my_pass"
).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 2 MiB
Languages
Swift 99.7%
Shell 0.3%