Skip to content

BunRedis

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.

3 exports Added in v4.0.0 Source

Layers

layer

Added in v4.0.0 Source

Creates scoped Bun Redis layers for Redis.Redis and BunRedis, closing the underlying client when the scope finalizes.

Signature

declare function layer(options?: any): Layer<BunRedis | Redis>;

layerConfig

Added in v4.0.0 Source

Creates scoped Bun Redis layers from configurable Redis options, closing the underlying client when the scope finalizes.

Signature

declare function layerConfig(options: Config<any>): Layer<BunRedis | Redis, ConfigError>;

Services

BunRedis

Added in v4.0.0 Source

Service tag for Bun Redis integration, exposing the raw RedisClient and a use helper that maps client promise failures to RedisError.

Signature

declare class BunRedis extends Shape<
  "@effect/platform-bun/BunRedis",
  {
    readonly client: RedisClient;
    readonly use: <A>(f: (client: RedisClient) => Promise<A>) => Effect<A, RedisError>;
  },
  this
> {
  constructor(_: never);
}