(20241226) With new bash scripts for SocketIO.

This commit is contained in:
2024-12-27 19:27:22 +05:30
parent 61777d7f05
commit 93a68cc078
4 changed files with 34 additions and 8 deletions
+5
View File
@@ -57,6 +57,7 @@ from models.finstitutions.trading.symbols import TradingSymbol
from models.finstitutions.trading.ticks import TradingTick
# To work with SocketIO:
import socket
import socketio
# For asynchronous activities:
@@ -80,6 +81,9 @@ from icecream import IceCreamDebugger
printer = IceCreamDebugger(prefix = "Tick-Disp, | ", includeContext = True)
printer.disable()
# General:
SERVER_HOSTNAME = str(socket.gethostname())
# For SocketIO:
sio = socketio.AsyncServer(async_mode = "asgi")
app = socketio.ASGIApp(sio)
@@ -238,6 +242,7 @@ async def init():
ticks_from_kafka,
consumer = ConsumerKafka(
topic = "tickers",
group_id = f"{SERVER_HOSTNAME}_tickers",
bootstrap_servers = "del.ditscentre.in:9092",
security_protocol = "SSL",
ssl_context = get_ssl_context(