Skip to content

Jobs Redis Driver

In order to setup the Redis jobs driver, add the following to your SPM manifest:

// swift-tools-version:5.1
import PackageDescription

let package = Package(
    name: "MyApp",
    dependencies: [
        /// Any other dependencies ...
        .package(url: "", from: "0.2.0"),
    targets: [
        .target(name: "App", dependencies: ["JobsRedisDriver", ...]),
        .target(name: "Run", dependencies: ["App"]),
        .testTarget(name: "AppTests", dependencies: ["App"]),

Don't forget to add the module as a dependency in the targets array. Once you have added the dependency, regenerate your Xcode project with the following command:


In your configure.swift file, add the following:

guard let url = URL(string: "redis://") else { throw Abort(.internalServerError) }
guard let redisConfiguration = RedisConfiguration(url: url) else { throw Abort(.internalServerError) }

services.register(JobsPersistenceLayer.self) { container -> JobsRedisDriver in
    let redisClient = RedisConnectionSource(config: redisConfiguration, eventLoop:
    return JobsRedisDriver(client: redisClient, eventLoop: