production-evyos-systems-an.../ServicesTask/app/services/queue/main.py

18 lines
477 B
Python

import uuid
import asyncio
from app.services.common.service_base_async import ServiceBaseAsync
async def produce(service: ServiceBaseAsync):
print(f"Queue Reader Service up and running.")
while True:
await asyncio.sleep(1)
async def consume(service: ServiceBaseAsync, job: dict):
await asyncio.sleep(0.1)
print(f"Queue Sender Service up and running. Job: {job}")
if __name__ == "__main__":
asyncio.run(ServiceBaseAsync(produce, consume).run())