#15 - Implement Backpressure UPDATE & IDLE, setup AMQ handler in its own thread
This commit is contained in:
@@ -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:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user