CryptoSentinel_AI / app /broker.py
mgbam's picture
Create app/broker.py
17ad72e verified
raw
history blame contribute delete
384 Bytes
"""
A singleton message broker for the application.
This ensures that the same asyncio.Queue instance is shared across all parts
of the application, including background tasks and API request handlers.
"""
import asyncio
class SignalBroker:
def __init__(self):
self.queue = asyncio.Queue()
# Create a single, global instance of the broker.
signal_broker = SignalBroker()