Skip to main content

CurateClick

github.com favicon

基于Redis Stream的Python异步队列库

一个基于Redis Stream构建的Python异步队列库,支持Asyncio、推迟任务、死信队列和多消费者功能。

Check out 基于Redis Stream的Python异步队列库 on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

基于最新的Redis版本构建的异步队列库,受启发于arq仓库: https://github.com/Wh1isper/brqLICENSE:[BSD-3-Clause license](https://github.com/Wh1isper/brq#BSD-3-Clause-1-ov-file)特性:- 异步Asyncio支持- 推迟任务、死信队列- 多消费者支持#### 生产者代码案例pythonimport osfrom brq.producer import Producerfrom brq.tools import get_redis_client, get_redis_urlasync def main(): redis_url = get_redis_url( host=os.getenv("REDIS_HOST", "localhost"), port=int(os.getenv("REDIS_PORT", 6379)), db=int(os.getenv("REDIS_DB", 0)), cluster=bool(os.getenv("REDIS_CLUSTER", False)), tls=bool(os.getenv("REDIS_TLS", False)), ) async with get_redis_client(redis_url) as async_redis_client: await Producer(async_redis_client).run_job("echo", ["hello"])if __name__ == "__main__": import asyncio asyncio.run(main())#### 消费者代码案例pythonimport osfrom brq.consumer import Consumerfrom brq.daemon import Daemonfrom brq.tools import get_redis_client, get_redis_urlasync def echo(message): print(message)async def main(): redis_url = get_redis_url( host=os.getenv("REDIS_HOST", "localhost"), port=int(os.getenv("REDIS_PORT", 6379)), db=int(os.getenv("REDIS_DB", 0)), cluster=bool(os.getenv("REDIS_CLUSTER", False)), tls=bool(os.getenv("REDIS_TLS", False)), ) async with get_redis_client(redis_url) as async_redis_client: daemon = Daemon(Consumer(async_redis_client, echo)) await daemon.run_forever()if __name__ == "__main__": import asyncio asyncio.run(main())

Latest Weekly Picks

freeadhd.com favicon
Weekly Pick

ADHD Test - a free, no-sign-up adult ADHD self-screening tool with instant results.

ADHD Test
pixmira.ai favicon
Weekly Pick

Free AI photo editor and image generator for fast visual creation.

PixMira AI
pslratings.com favicon
Weekly Pick

Free PSL Rating gives an instant AI PSL score with tier and four category breakdowns, no signup.

Free PSL Rating
gothic1remake.com favicon
Weekly Pick

Gothic 1 Remake Guide — Release, Walkthroughs & Quests

gothic 1 remake

Predict video virality before you publish.

Virality Predictor

Powerful Motion Control AI Video Generator

Motion Control AI

PlusGO 是面向中国大陆用户的 ChatGPT Plus 代充值服务平台。使用官方 CDKey,支持支付宝和微信扫码支付,平均 2 分钟完成 Plus 开通,自 2025 年起已为超过 10,000 名用户完成充值。

www.toolcenter.ai favicon
Weekly Pick

Discover the Best AI & Productivity Tools — 1,500+ tools with honest reviews.

ToolCenter