File size: 384 Bytes
e5df665
 
 
17ad72e
e5df665
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"""
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()