@axiom-lattice/queue-redis

中文文档
1.1.32发布于 2026/11/03MITTypeScriptESM + CJS近 30 天下载 2776

Axiom Lattice 框架的 Redis 队列客户端执行

中文使用文档
文档目录7 节
  1. 概览
  2. 安装
  3. 使用量
  4. 基本用途
  5. 直接使用
  6. 配置
  7. 许可证

@axiom-lattice/ queue- redis

Axiom Lattice 框架的 Redis 队列客户端执行 .

概览

此软件包提供了一个基于 Redis 的队列客户端执行,符合 QueueClient 界面定义于 @axiom-lattice/protocols。可以与 QueueLatticeManager 从 @axiom-lattice/core 以注册和管理基于 Redis 的队列服务.

安装

pnpm add @axiom-lattice/queue-redis

使用量

基本用途

import { RedisQueueClient } from "@axiom-lattice/queue-redis";
import { registerQueueLattice } from "@axiom-lattice/core";
import { QueueType } from "@axiom-lattice/protocols";

// Register Redis queue service
registerQueueLattice("redis-queue", {
  name: "Redis Queue Service",
  description: "Redis-based queue service",
  type: QueueType.REDIS,
  queueName: "tasks",
  options: {
    redisUrl: process.env.REDIS_URL || "redis://localhost:6379",
    redisPassword: process.env.REDIS_PASSWORD,
  },
});

// Get and use the queue
import { getQueueLattice } from "@axiom-lattice/core";
const queue = getQueueLattice("redis-queue");

// Push item to queue
await queue.push({ task: "example" });

// Pop item from queue
const result = await queue.pop();

直接使用

import { RedisQueueClient } from "@axiom-lattice/queue-redis";

const client = new RedisQueueClient("tasks", {
  redisUrl: "redis://localhost:6379",
  redisPassword: "your-password",
});

// Push item
await client.push({ data: "example" });

// Pop item
const result = await queue.pop();

配置

Redis 队列客户端可以通过 :

  1. 构造选项: 传出 redisUrl 财务报告和审定财务报表 redisPassword 直接
  2. 环境变量数字 :
    • REDIS_URL (默认 : redis://localhost:6379(中文(简体) )
    • REDIS_PASSWORD (可选)

许可证

麻省理工学院

版本与发布记录

@axiom-lattice/queue-redis 共发布 91 个版本,首次发布于 2025/12/29;过去 12 个月发布了 91 个版本。

版本发布日期距今
1.1.32latest2026/11/034 天前
1.1.312026/11/025 天前
1.1.302026/10/317 天前
1.1.292026/10/299 天前
1.1.282026/10/2810 天前
1.1.272026/10/2612 天前

其他发布通道:hotfix → 1.0.8-hotfix.0。

关于 @axiom-lattice/queue-redis 的常见问题

@axiom-lattice/queue-redis 是什么?

Axiom Lattice 框架的 Redis 队列客户端执行

如何安装 @axiom-lattice/queue-redis?

在项目目录运行 npm install @axiom-lattice/queue-redis,或使用 pnpm add / yarn add / bun add。

@axiom-lattice/queue-redis 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@axiom-lattice/queue-redis 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@axiom-lattice/queue-redis 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@axiom-lattice/queue-redis 可以商用吗?

@axiom-lattice/queue-redis 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@axiom-lattice/queue-redis 的下载量有多少?

根据 npm 官方下载统计,@axiom-lattice/queue-redis 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,776 次,日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@axiom-lattice/queue-redis 还在维护吗?

最新版本 1.1.32 发布于 2026/11/03(4 天前);至今共发布 91 个版本,其中过去 12 个月发布了 91 个;首次发布于 2025/12/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。