Redis Documentation

Structure Application.​Redis

public struct Redis  
%7 Application.Redis Application.Redis RedisClient RedisClient Application.Redis->RedisClient

Nested Types

Application.Redis.Sessions

Conforms To

RedisClient

Properties

id

public let id: RedisID

event​Loop

public var eventLoop: EventLoop  

configuration

public var configuration: RedisConfiguration?  

The Redis configuration to use to communicate with a Redis instance.

See Application.Redis.id

sessions

public var sessions: Sessions  

Methods

logging(to:​)

public func logging(to logger: Logger) -> RedisClient  

send(command:​with:​)

public func send(command: String, with arguments: [RESPValue]) -> EventLoopFuture<RESPValue>  

subscribe(to:​message​Receiver:​on​Subscribe:​on​Unsubscribe:​)

public func subscribe(
        to channels: [RedisChannelName],
        messageReceiver receiver: @escaping RedisSubscriptionMessageReceiver,
        onSubscribe subscribeHandler: RedisSubscriptionChangeHandler?,
        onUnsubscribe unsubscribeHandler: RedisSubscriptionChangeHandler?
    ) -> EventLoopFuture<Void>  

unsubscribe(from:​)

public func unsubscribe(from channels: [RedisChannelName]) -> EventLoopFuture<Void>  

psubscribe(to:​message​Receiver:​on​Subscribe:​on​Unsubscribe:​)

public func psubscribe(
        to patterns: [String],
        messageReceiver receiver: @escaping RedisSubscriptionMessageReceiver,
        onSubscribe subscribeHandler: RedisSubscriptionChangeHandler?,
        onUnsubscribe unsubscribeHandler: RedisSubscriptionChangeHandler?
    ) -> EventLoopFuture<Void>  

punsubscribe(from:​)

public func punsubscribe(from patterns: [String]) -> EventLoopFuture<Void>  

with​Borrowed​Connection(_:​)

@inlinable
    public func withBorrowedConnection<Result>(
        _ operation: @escaping (RedisClient) -> EventLoopFuture<Result>
    ) -> EventLoopFuture<Result>  

Provides temporary exclusive access to a single Redis client.

See RedisConnectionPool.leaseConnection(_:) for more details.

send(command:​with:​)

public func send(command: String, with arguments: [RESPValue]) async throws -> RESPValue  

subscribe(to:​message​Receiver:​on​Subscribe:​on​Unsubscribe:​)

public func subscribe(
        to channels: [RedisChannelName],
        messageReceiver receiver: @escaping RedisSubscriptionMessageReceiver,
        onSubscribe subscribeHandler: RedisSubscriptionChangeHandler?,
        onUnsubscribe unsubscribeHandler: RedisSubscriptionChangeHandler?
    ) async throws  

unsubscribe(from:​)

public func unsubscribe(from channels: [RedisChannelName]) async throws  

psubscribe(to:​message​Receiver:​on​Subscribe:​on​Unsubscribe:​)

public func psubscribe(
        to patterns: [String],
        messageReceiver receiver: @escaping RedisSubscriptionMessageReceiver,
        onSubscribe subscribeHandler: RedisSubscriptionChangeHandler?,
        onUnsubscribe unsubscribeHandler: RedisSubscriptionChangeHandler?
    ) async throws  

punsubscribe(from:​)

public func punsubscribe(from patterns: [String]) async throws