Unverified Commit 0bff06ca authored by Hong Minhee's avatar Hong Minhee
Browse files

Export @fedify/redis/mq module

parent ad90c745
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ implementations for Redis:
[`KvStore`]: https://jsr.io/@fedify/fedify/doc/federation/~/KvStore
[`MessageQueue`]: https://jsr.io/@fedify/fedify/doc/federation/~/MessageQueue
[`RedisKvStore`]: https://jsr.io/@fedify/redis/doc/kv/~/RedisKvStore
[`RedisMessageQueue`]: https://jsr.io/@fedify/redis/doc/kv/~/RedisMessageQueue
[`RedisMessageQueue`]: https://jsr.io/@fedify/redis/doc/mq/~/RedisMessageQueue


Changelog
@@ -31,7 +31,9 @@ Changelog

### Version 0.1.1

To be released.
Released on June 22, 2024.

 -  Exported `@fedify/redis/mq` module.

### Version 0.1.0

+2 −1
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@
  "exports": {
    ".": "./mod.ts",
    "./codec": "./src/codec.ts",
    "./kv": "./src/kv.ts"
    "./kv": "./src/kv.ts",
    "./mq": "./src/mq.ts"
  },
  "imports": {
    "@deno/dnt": "jsr:@deno/dnt@^0.41.2",
+5 −1
Original line number Diff line number Diff line
@@ -38,7 +38,11 @@ await build({
    },
  },
  outDir: "./npm",
  entryPoints: ["./mod.ts"],
  entryPoints: [
    "./mod.ts",
    { name: "./kv", path: "./src/kv.ts" },
    { name: "./mq", path: "./src/mq.ts" },
  ],
  importMap,
  shims: {
    deno: true,
+9 −0
Original line number Diff line number Diff line
@@ -4,11 +4,20 @@ import { Redis } from "ioredis";
import { RedisMessageQueue } from "./mq.ts";

Deno.test("RedisMessageQueue", async (t) => {
  const channelKey = `fedify_test_channel_${crypto.randomUUID()}`;
  const queueKey = `fedify_test_queue_${crypto.randomUUID()}`;
  const lockKey = `fedify_test_lock_${crypto.randomUUID()}`;
  const mq = new RedisMessageQueue(() => new Redis(), {
    loopInterval: { seconds: 1 },
    channelKey,
    queueKey,
    lockKey,
  });
  const mq2 = new RedisMessageQueue(() => new Redis(), {
    loopInterval: { seconds: 1 },
    channelKey,
    queueKey,
    lockKey,
  });

  const messages: string[] = [];