Skip to content

NodeRedis.ts

Node.js Redis integration backed by ioredis.

This module creates a scoped ioredis client and exposes it in two forms: the generic Redis service and the NodeRedis service for direct access to the underlying client. layer accepts ioredis options directly, while layerConfig reads them from Effect config. Both layers close the client when the layer scope ends.

Since v4.0.0



Provides Redis and NodeRedis services backed by an ioredis client created with the supplied options and closed when the layer scope ends.

Signature

declare const layer: (options?: IoRedis.RedisOptions | undefined) => Layer.Layer<Redis.Redis | NodeRedis>

Source

Since v4.0.0

Provides Redis and NodeRedis services from Config-backed ioredis options, closing the client when the layer scope ends.

Signature

declare const layerConfig: (
options: Config.Wrap<IoRedis.RedisOptions>
) => Layer.Layer<Redis.Redis | NodeRedis, Config.ConfigError>

Source

Since v4.0.0

Service tag for the Node Redis integration, exposing the underlying ioredis client and a use helper that maps client failures to RedisError.

Signature

declare class NodeRedis

Source

Since v4.0.0