hummingbird-redis

2.0.0

Hummingbird integration with Redis driver RediStack
hummingbird-project/hummingbird-redis

What's New

v2.0.0

2025-01-10T12:21:22Z

Major version changes

  • hummingbird-redis has been updated to work with Hummingbird v2.0
  • Added RedisConnectionPoolService to manage lifecycle of redis client

Hummingbird Redis Interface

Redis is an open source, in-memory data structure store, used as a database, cache, and message broker.

This is the Hummingbird interface to RediStack library a Swift driver for Redis.

Usage

import Hummingbird
import HummingbirdRedis

let redis = try RedisConnectionPoolService(
    .init(hostname: redisHostname, port: 6379),
    logger: Logger(label: "Redis")
)

// create router and add a single GET /redis route
let router = Router()
router.get("redis") { request, _ -> String in
    let info = try await redis.send(command: "INFO").get()
    return String(describing: info)
}
// create application using router
var app = Application(
    router: router,
    configuration: .init(address: .hostname("127.0.0.1", port: 8080))
)
app.addServices(redis)
// run hummingbird application
try await app.runService()

Documentation

Reference documentation for HummingbirdRedis can be found here

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Wed May 14 2025 19:33:14 GMT-0900 (Hawaii-Aleutian Daylight Time)