Full documentation is available at https://aio-pika.readthedocs.io/en/latest/ .
from orbilite import Orbilite
task_manager = Orbilite('amqp://localhost/')
import asyncio
@task_manager.task(queue_name='main')
async def sleep_function(seconds):
await asyncio.sleep(seconds)
import asyncio
loop = asyncio.get_event_loop()
async def main():
await sleep_function(1)
if __name__ == '__main__':
loop.create_task(main())
loop.run_forever()
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()
- Python >= 3.6