Skip to content

Orbilite: Async task manager on RabbitMQ queue and aio_pika package

License

Notifications You must be signed in to change notification settings

lordent/orbilite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orbilite: Async task manager on RabbitMQ queue and aio_pika package

aio_pika Documentation

Full documentation is available at https://aio-pika.readthedocs.io/en/latest/ .

Usage examples

Create manager instance

from orbilite import Orbilite


task_manager = Orbilite('amqp://localhost/')

Decorate function as task

import asyncio


@task_manager.task(queue_name='main')
async def sleep_function(seconds):
    await asyncio.sleep(seconds)

Call decorated function

import asyncio

loop = asyncio.get_event_loop()


async def main():
    await sleep_function(1)


if __name__ == '__main__':
    loop.create_task(main())
    loop.run_forever()

Consume queue

import asyncio

loop = asyncio.get_event_loop()


async def main():
    await task_manager.consume_queue('main')


if __name__ == '__main__':
    loop.create_task(main())
    loop.run_forever()

Requirements

  • Python >= 3.6

About

Orbilite: Async task manager on RabbitMQ queue and aio_pika package

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages