Begin implementing RTS process

This commit is contained in:
Mark Veidemanis 2025-01-23 11:30:01 +00:00
parent 1cc2ef629e
commit 352909bec0
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

31
rts.py Normal file
View File

@ -0,0 +1,31 @@
import asyncio
from os import getenv
import uvloop
import util
# Use UVLoop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
log = util.get_logger("rts")
modules_enabled = getenv("MODULES_ENABLED", False)
if "rts" not in modules_enabled:
log.info("RTS disabled.")
exit(0)
async def main(loop):
log.info("RTS started.")
loop = asyncio.get_event_loop()
loop.create_task(main(loop))
try:
loop.run_forever()
except KeyboardInterrupt:
log.info("RTS process terminating")
finally:
loop.close()