登录 注册
其他 asynchronous-tasksbackground-jobsgogolangredistask-queue
13,829
Stars
992
Forks
83
Watchers
285
Open Issues
MIT
许可证
Go
语言
2019-11-15
创建时间
2026-11-11
最近更新

项目能做什么

基于 Go 语言的简单、可靠、高效的分布式任务队列。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
<img src="https://user-images.githubusercontent.com/11155743/114697792-ffbfa580-9d26-11eb-8e5b-33bef69476dc.png" alt="Asynq logo" width="360px" />

# Simple, reliable & efficient distributed task queue in Go

[![GoDoc](https://godoc.org/github.com/hibiken/asynq?status.svg)](https://godoc.org/github.com/hibiken/asynq)
[![Go Report Card](https://goreportcard.com/badge/github.com/hibiken/asynq)](https://goreportcard.com/report/github.com/hibiken/asynq)
![Build Status](https://github.com/hibiken/asynq/workflows/build/badge.svg)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Gitter chat](https://badges.gitter.im/go-asynq/gitter.svg)](https://gitter.im/go-asynq/community)

Asynq is a Go library for queueing tasks and processing them asynchronously with workers. It's backed by [Redis](https://redis.io/) and is designed to be scalable yet easy to get started.

Highlevel overview of how Asynq works:

- Client puts tasks on a queue
- Server pulls tasks off queues and starts a worker goroutine for each task
- Tasks are processed concurrently by multiple workers

Task queues are used as a mechanism to distribute work across multiple machines. A system can consist of multiple worker servers and brokers, giving way to high availability and horizontal scaling.

**Example use case**

![Task Queue Diagram](https://user-images.githubusercontent.com/11155743/116358505-656f5f80-a806-11eb-9c16-94e49dab0f99.jpg)

## Features

- Guaranteed [at least one execution](https://www.cloudcomputingpatterns.org/at_least_once_delivery/) of a task
- Scheduling of tasks
- [Retries](https://github.com/hibiken/asynq/wiki/Task-Retry) of failed tasks
- Automatic recovery of tasks in the event of a worker crash
- [Weighted priority queues](https://github.com/hibiken/asynq/wiki/Queue-Priority#weighted-priority)
- [Strict priority queues](https://github.com/hibiken/asynq/wiki/Queue-Priority#strict-priority)
- Low latency to add a task since writes are fast in Redis
- De-duplication of tasks using [unique option](https://github.com/hibiken/asynq/wiki/Unique-Tasks)
- Allow [timeout and deadline per task](https://github.com/hibiken/asynq/wiki/Task-Timeout-and-Cancelation)
- Allow [aggregating group of tasks](https://github.com/hibiken/asynq/wiki/Task-aggregation) to batch multiple successive operations
- [Flexible handler interface with support for middlewares](https://github.com/hibiken/asynq/wiki/Handler-Deep-Dive)
- [Ability to pause queue](/tools/asynq/README.md#pause) to stop processing tasks from the queue
- [Periodic Tasks](https://github.com/hibiken/asynq/wiki/Periodic-Tasks)
- [Support Redis Sentinels](https://github.com/hibiken/asynq/wiki/Automatic-Failover) for high availability
- Integration with [Prometheus](https://prometheus.io/) to collect and visualize queue metrics
- [Web UI](#web-ui) to inspect and remote-control queues and tasks
- [CLI](#command-line-tool) to inspect and remote-control queues and tasks

## St
阅读完整原文

商业机会分析 AI 生成

Asynq Pro 企业级可观测性与运维管控控制台(商业化 Dashboard)

产品构想官方目前仅有基础 Web UI 和 CLI。基于此开发功能更强大的企业级控制台,支持多实例多集群聚合监控、精细化 RBAC 权限控制、任务排错重放、死信队列智能分析、飞书/钉钉/Slack 告警集成。
核心功能多 Redis 集群统一看板;任务失败归因与历史追踪;一键重放/批量终止/死信导出;团队多角色权限隔离(RBAC);Webhook/告警通道集成。
目标用户中大型使用 Asynq 的企业研发团队、SRE 运维工程师。
难度/周期中等 · 2 - 3 个月 · 成本:低(基础云服务器、前端组件库与后端适配开发)
收费模式按实例/节点订阅收费(商业许可证 License)或提供私有化部署买断制。
竞争风险官方可能会逐步增强现有的开源 Web UI;需要持续跟随 Asynq 核心数据结构迭代。
依据 已验证事实

企业级 Redis Cluster 兼容方案与高可用中间件扩展

产品构想针对 README 中明确提到的部分 Lua 脚本在 Redis Cluster 下不兼容的痛点,提供商业级/插件级的 Redis Cluster 拓扑支持、分片路由、故障容灾及大规模吞吐保障扩展包。
核心功能跨分片 Lua 脚本兼容与重写;动态 Slot 路由优化;超大规模队列吞吐缓冲;故障自动转移优化。
目标用户数据量大、必须采用 Redis Cluster 进行横向扩展的中大型互联网公司。
难度/周期高 · 3 - 5 个月 · 成本:低(主要为高负载性能测试的 Redis 集群云资源成本)
收费模式按企业商业插件授权收费(Dual License / Commercial License)或咨询服务形式。
竞争风险Redis Cluster 本身分布式事务/跨节点原子操作限制较高,Lua 改造难度大;官方未来可能自行重构兼容。
依据 已验证事实

全托管 Cloud Task / Asynq 云原生托管后台任务平台

产品构想提供开箱即用的托管式 Asynq 任务队列云服务,集成高可用 Redis,用户无需自建运维,仅需通过 SDK/HTTP 投递和挂载 Worker,并配备完整的追踪与审计日志。
核心功能免运维 Serverless 队列接入点;内置高可用 Redis 存储;HTTP/gRPC/Go SDK 任务触发;自动弹性伸缩指标看板;失败任务自动对账。
目标用户中小创业团队、独立开发者、不想维护 Redis 基础设施的全栈工程师。
难度/周期中等 · 3 - 4 个月 · 成本:中等(托管云 Redis 实例成本、带宽及多租户隔离架构成本)
收费模式SaaS 订阅制(基础免费配额 + 按任务调用量/并发队列数阶梯计费)。
竞争风险与 AWS SQS/GCP Cloud Tasks 等公有云基础服务存在竞争,自研服务稳定性背书压力大。
依据 数据支持的判断
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
resque/resque 中文介绍暂未生成
Resque is a Redis-backed Ruby library for creating backgroun
9,467 Ruby
microsoft/cpprestsdk 中文介绍暂未生成
The C++ REST SDK is a Microsoft project for cloud-based clie
8,241 C++
RichardKnop/machinery 中文介绍暂未生成
Machinery is an asynchronous task queue/job queue based on d
7,983 Go
stephanenicolas/robospice 中文介绍暂未生成
Repo of the Open Source Android library : RoboSpice. RoboSpi
2,922 Java
JacksonTian/eventproxy 中文介绍暂未生成
An implementation of task/event based asynchronous pattern.
2,919 JavaScript
d3/d3-queue 中文介绍暂未生成
Evaluate asynchronous tasks with configurable concurrency.
1,397 JavaScript
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2019-11-15,近 30 天仍在推送,发布过 32 个 Release
社区活跃Star 13,829 / Fork 992 / Issue 285(数据支持,可自行核实)
许可证MIT
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/hibiken/asynq.git
cd asynq
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。