NodeRedis.ts
NodeRedis.ts overview
Section titled “NodeRedis.ts overview”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
Exports Grouped by Category
Section titled “Exports Grouped by Category”layers
Section titled “layers”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>Since v4.0.0
layerConfig
Section titled “layerConfig”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>Since v4.0.0
services
Section titled “services”NodeRedis (class)
Section titled “NodeRedis (class)”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 NodeRedisSince v4.0.0