repid
Repid is a simple, fast, and extensible async task queue framework, with built-in AsyncAPI 3.0 schema generation.
pip install repid
Features
- AsyncAPI 3.0 out of the box - your schema is generated automatically as you build.
- Broker flexibility - works with RabbitMQ, Redis, AWS SQS, Kafka, NATS,
- Extreme performance - built for maximum throughput and minimal overhead,
- Developer ergonomics - define actors as plain async functions with dependency
- Built for testability - a drop-in
TestClientlets you test actors in-memory
- LLM-friendly documentation - grab
llms.txtorllms-full.txtfrom the docs site
Quickstart
Here is how the simplest producer-consumer application looks, using AMQP server.
Producer:
import asyncio
from repid import AmqpServer, Repid
app = Repid(title="My App", version="1.0.0")
app.servers.register_server(
"default",
AmqpServer("amqp://user:password@localhost:5672"),
is_default=True,
)
async def main() -> None:
async with app.servers.default.connection():
await app.send_message(
channel="default",
payload=b"",
headers={"topic": "awesome_job"},
)
asyncio.run(main())
Consumer:
import asyncio
from repid import AmqpServer, Repid, Router
app = Repid(title="My App", version="1.0.0")
app.servers.register_server(
"default",
AmqpServer("amqp://user:password@localhost:5672"),
is_default=True,
)
router = Router()
@router.actor
async def awesome_job() -> None:
print("Hello async jobs!")
await asyncio.sleep(1.0)
app.include_router(router)
async def main() -> None:
async with app.servers.default.connection():
await app.run_worker()
asyncio.run(main())
Check out [user guide] to learn more!
License
Repid is distributed under the terms of the MIT license. Please see [License.md] for more information.
Repid's logo is distributed under the terms of the [CC BY-NC 4.0] license. It is originally created by [ari_the_crow_].
[License.md]: https://github.com/aleksul/repid/blob/master/LICENSE [user guide]: https://repid.aleksul.space [CC BY-NC 4.0]: https://creativecommons.org/licenses/by-nc/4.0/ [ari_the_crow_]: https://www.instagram.com/p/Cd-ob1NNZ84/