Skip to main content

Built and signed on GitHub Actions

Works with
This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score100%
License
MIT
Downloads80/wk
Publisheda week ago (2.2.0)

Redis drivers for Fedify

Classes

c
CodecError(message: string)

An error that occurs when encoding or decoding data.

c
DecodingError(message: string)

An error that occurs when decoding data.

c
EncodingError(message: string)

An error that occurs when encoding data.

c

A codec that encodes and decodes JavaScript objects to and from JSON.

  • decode(encoded: Buffer): unknown
    No documentation available
  • encode(value: unknown): Buffer
    No documentation available
c
RedisKvStore(
redis: Redis | Cluster,
options?: RedisKvStoreOptions
)

A key–value store that uses Redis as the underlying storage.

  • delete(key: KvKey): Promise<void>
    No documentation available
  • get<T = unknown>(key: KvKey): Promise<T | undefined>
    No documentation available
  • list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>

    {@inheritDoc KvStore.list}

  • set(
    key: KvKey,
    value: unknown,
    options?: KvStoreSetOptions | undefined
    ): Promise<void>
    No documentation available
c
RedisMessageQueue(
redis: () => Redis | Cluster,
options?: RedisMessageQueueOptions
)

A message queue that uses Redis as the underlying storage.

  • enqueue(
    message: any,
    options?: MessageQueueEnqueueOptions
    ): Promise<void>
    No documentation available
  • enqueueMany(
    messages: readonly any[],
    options?: MessageQueueEnqueueOptions
    ): Promise<void>
    No documentation available
  • listen(
    handler: (message: any) => void | Promise<void>,
    options?: MessageQueueListenOptions
    ): Promise<void>
    No documentation available

Interfaces

I

Encode and decodes JavaScript objects to and from binary data.

  • decode(encoded: Buffer): unknown

    Decodes a JavaScript object from binary data.

  • encode(value: unknown): Buffer

    Encodes a JavaScript object to binary data.

I
  • codec: Codec

    The codec to use for encoding and decoding values in the key–value store. Defaults to JsonCodec.

  • keyPrefix: RedisKey

    The prefix to use for all keys in the key–value store in Redis. Defaults to "fedify::".

  • channelKey: RedisKey

    The Pub/Sub channel key to use for the message queue. "fedify_channel" by default.

  • codec: Codec

    The codec to use for encoding and decoding messages in the key–value store. Defaults to JsonCodec.

  • lockKey: RedisKey

    The key to use for locking the message queue. "fedify_lock" by default.

  • pollInterval: Temporal.Duration | Temporal.DurationLike

    The poll interval for the message queue. 5 seconds by default.

  • queueKey: RedisKey

    The Sorted Set key to use for the delayed message queue. "fedify_queue" by default.

  • workerId: string

    The unique identifier for the worker that is processing messages from the queue. If this is not specified, a random identifier will be generated. This is used to prevent multiple workers from processing the same message, so it should be unique for each worker.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/redis

Import symbol

import * as mod from "@fedify/redis";
or

Import directly with a jsr specifier

import * as mod from "jsr:@fedify/redis";