License Build Swift Redis

Swift Redis NIO Client

A non-blocking Swift client for Redis built on top of SwiftNIO.

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

Installation

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

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

and run the following command: swift package resolve

Getting Started

RedisNIO is ready to use right after installation.

import RedisNIO

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 RedisNIO.

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

docker run -d -p 6379:6379 --name redisnio 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%