基于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

make.ink favicon
Weekly Pick

Your AI tattoo generator for pro-grade concepts

Leo Wade
sellfy.com favicon
Weekly Pick

A code-free online store builder to turn views into revenue. Sell digital products, subscriptions, and merch, without fees or hassle.

Maris
www.videotoblog.ai favicon
Weekly Pick

Convert videos into awesome blog posts.

Video To Blog
www.sellerpic.ai favicon
Weekly Pick

SellerPic is the all-in-one AI design platform for e-commerce

SellerPic
fastimage.ai favicon
Weekly Pick

Fast Image AI instantly transforms your photos into stunning styles like Ghibli, Sketch, and Pixar. Effortlessly control image elements and create amazing effects with just one click.

Fast AI Team
linkedinpro.daisy.so favicon
Weekly Pick

AI-powered tool that transforms casual photos into professional LinkedIn headshots instantly. No photographer needed—just upload and download.

Gabriel
crevas.ai favicon
Weekly Pick

Crevas unifies Veo 3, Sora 2, Nano Banana and more into one intuitive canvas — so filmmakers can script, prompt, and generate cinematic stories without switching tools or losing consistency.

Spark Alpha
fotominiatur.com favicon
Weekly Pick

AI Foto Edit - Text to Image & Image Edit

foto miniatur