BunRedis.ts
BunRedis.ts overview
Section titled “BunRedis.ts overview”Bun Redis integration backed by Bun’s built-in RedisClient.
This module creates scoped Bun RedisClient connections and exposes them as
both the portable Redis service and the Bun-specific BunRedis service for
direct access to the raw client. The layer helper accepts Redis options
directly, while layerConfig reads them from Effect config. Both close the
underlying client when the layer scope finalizes.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”layers
Section titled “layers”Creates scoped Bun Redis layers for Redis.Redis and BunRedis, closing the underlying client when the scope finalizes.
Signature
declare const layer: ( options?: ({ readonly url?: string } & RedisOptions) | undefined) => Layer.Layer<Redis.Redis | BunRedis>Since v4.0.0
layerConfig
Section titled “layerConfig”Creates scoped Bun Redis layers from configurable Redis options, closing the underlying client when the scope finalizes.
Signature
declare const layerConfig: ( options: Config.Wrap<{ readonly url?: string } & RedisOptions>) => Layer.Layer<Redis.Redis | BunRedis, Config.ConfigError>Since v4.0.0
services
Section titled “services”BunRedis (class)
Section titled “BunRedis (class)”Service tag for Bun Redis integration, exposing the raw RedisClient and a use helper that maps client promise failures to RedisError.
Signature
declare class BunRedisSince v4.0.0