mirror of
https://github.com/openmax-server/server.git
synced 2026-06-18 08:58:27 +03:00
first commit
This commit is contained in:
23
src/tamtam_tcp/controller.py
Normal file
23
src/tamtam_tcp/controller.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import asyncio
|
||||
from tamtam_tcp.server import TTMobileServer
|
||||
from classes.controllerbase import ControllerBase
|
||||
from common.config import ServerConfig
|
||||
|
||||
class TTMobileController(ControllerBase):
|
||||
def __init__(self):
|
||||
self.config = ServerConfig()
|
||||
|
||||
def launch(self, api):
|
||||
async def _start_all():
|
||||
await asyncio.gather(
|
||||
TTMobileServer(
|
||||
host=self.config.host,
|
||||
port=self.config.tamtam_tcp_port,
|
||||
ssl_context=api['ssl'],
|
||||
db_pool=api['db'],
|
||||
clients=api['clients'],
|
||||
send_event=api['event']
|
||||
).start()
|
||||
)
|
||||
|
||||
return _start_all()
|
||||
Reference in New Issue
Block a user