#15 - Implement Backpressure UPDATE & IDLE, setup AMQ handler in its own thread

This commit is contained in:
Stanislav Hejny
2025-04-28 00:49:35 +01:00
parent 88d45a9b67
commit 3dfb7a821d
10 changed files with 213 additions and 77 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ import importlib
import pathlib
import re
from collections import defaultdict
from threading import Thread
from typing import Optional, List, Dict
from aiohttp import ClientSession
from fastapi.routing import APIRoute
@@ -128,7 +129,8 @@ class CleverSwarmAmqpAdapter(CleverThisServiceAdapter):
super().__init__(amq_configuration, session)
self.routes = group_routes_by_method(api_routes=api.api_router.routes)
_amq_service: AMQService = AMQService(amq_configuration, self)
_amq_service.rabbit_mq_client.channel.start_consuming()
self.thread = Thread(target=_amq_service.run)
self.thread.start()
async def get_current_user(self, token: str) -> UserSchema:
"""