Loading README.md +13 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,17 @@ implementations for Redis: - [`RedisKvStore`] - [`RedisMessageQueue`] ~~~~ typescript import { createFederation } from "@fedify/fedify"; import { RedisKvStore, RedisMessageQueue } from "@fedify/redis"; import { Redis } from "ioredis"; const federation = createFederation({ kv: new RedisKvStore(new Redis()), queue: new RedisMessageQueue(() => new Redis()), }); ~~~~ [JSR]: https://jsr.io/@fedify/redis [JSR badge]: https://jsr.io/badges/@fedify/redis [npm]: https://www.npmjs.com/package/@fedify/redis Loading Loading @@ -55,6 +66,8 @@ Changelog To be released. - Added some example code. ### Version 0.1.1 Released on June 22, 2024. Loading src/kv.ts +12 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,18 @@ export interface RedisKvStoreOptions { /** * A key-value store that uses Redis as the underlying storage. * * @example * ```ts * import { createFederation } from "@fedify/fedify"; * import { RedisKvStore } from "@fedify/redis"; * import { Redis } from "ioredis"; * * const federation = createFederation({ * // ... * kv: new RedisKvStore(new Redis()), * }); * ``` */ export class RedisKvStore implements KvStore { #redis: Redis; Loading src/mq.ts +12 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,18 @@ export interface RedisMessageQueueOptions { /** * A message queue that uses Redis as the underlying storage. * * @example * ```ts * import { createFederation } from "@fedify/fedify"; * import { RedisMessageQueue } from "@fedify/redis"; * import { Redis } from "ioredis"; * * const federation = createFederation({ * // ... * queue: new RedisMessageQueue(() => new Redis()), * }); * ``` */ export class RedisMessageQueue implements MessageQueue, Disposable { #redis: Redis; Loading Loading
README.md +13 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,17 @@ implementations for Redis: - [`RedisKvStore`] - [`RedisMessageQueue`] ~~~~ typescript import { createFederation } from "@fedify/fedify"; import { RedisKvStore, RedisMessageQueue } from "@fedify/redis"; import { Redis } from "ioredis"; const federation = createFederation({ kv: new RedisKvStore(new Redis()), queue: new RedisMessageQueue(() => new Redis()), }); ~~~~ [JSR]: https://jsr.io/@fedify/redis [JSR badge]: https://jsr.io/badges/@fedify/redis [npm]: https://www.npmjs.com/package/@fedify/redis Loading Loading @@ -55,6 +66,8 @@ Changelog To be released. - Added some example code. ### Version 0.1.1 Released on June 22, 2024. Loading
src/kv.ts +12 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,18 @@ export interface RedisKvStoreOptions { /** * A key-value store that uses Redis as the underlying storage. * * @example * ```ts * import { createFederation } from "@fedify/fedify"; * import { RedisKvStore } from "@fedify/redis"; * import { Redis } from "ioredis"; * * const federation = createFederation({ * // ... * kv: new RedisKvStore(new Redis()), * }); * ``` */ export class RedisKvStore implements KvStore { #redis: Redis; Loading
src/mq.ts +12 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,18 @@ export interface RedisMessageQueueOptions { /** * A message queue that uses Redis as the underlying storage. * * @example * ```ts * import { createFederation } from "@fedify/fedify"; * import { RedisMessageQueue } from "@fedify/redis"; * import { Redis } from "ioredis"; * * const federation = createFederation({ * // ... * queue: new RedisMessageQueue(() => new Redis()), * }); * ``` */ export class RedisMessageQueue implements MessageQueue, Disposable { #redis: Redis; Loading