djun / repid

Repid framework: simple to use, fast to run and extensible to adopt job scheduler

Home Page:http://repid.aleksul.space/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

repid

Repid's logo

PyPI version codecov Tests PyPI pyversions Code style: black Read documentation


Repid framework: simple to use, fast to run and extensible to adopt job scheduler.


pip install repid

Quickstart

Here is how the easiest example of producer-consumer application can look like.

Producer:

import asyncio

from repid import Connection, Job, RabbitMessageBroker, Repid

app = Repid(Connection(RabbitMessageBroker("amqp://user:password@localhost:5672")))


async def main() -> None:
    async with app.magic():
        await Job(name="awesome_job").enqueue()


asyncio.run(main())

Consumer:

import asyncio

from repid import Connection, RabbitMessageBroker, Repid, Router, Worker

app = Repid(Connection(RabbitMessageBroker("amqp://user:password@localhost:5672")))
router = Router()


@router.actor
async def awesome_job() -> None:
    print("Hello async jobs!")
    await asyncio.sleep(1.0)


async def main() -> None:
    async with app.magic():
        await Worker(routers=[router]).run()


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_.

About

Repid framework: simple to use, fast to run and extensible to adopt job scheduler

http://repid.aleksul.space/

License:MIT License


Languages

Language:Python 100.0%