kuhl-haus-mdp-servers 0.1.9__tar.gz → 0.1.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/PKG-INFO +1 -1
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/pyproject.toml +1 -1
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/mdl_server.py +11 -12
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/LICENSE.txt +0 -0
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/README.md +0 -0
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/__init__.py +0 -0
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/mdp_server.py +0 -0
- {kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/wds_server.py +0 -0
{kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/mdl_server.py
RENAMED
|
@@ -15,7 +15,6 @@ from kuhl_haus.mdp.helpers.utils import get_massive_api_key
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class Settings(BaseSettings):
|
|
18
|
-
# TODO: Retrieve Massive client settings from Service Control Plane API call
|
|
19
18
|
# Massive/Polygon.io API Key
|
|
20
19
|
massive_api_key: str = get_massive_api_key()
|
|
21
20
|
|
|
@@ -24,9 +23,9 @@ class Settings(BaseSettings):
|
|
|
24
23
|
feed: Union[str, Feed] = os.environ.get("MASSIVE_FEED", Feed.RealTime)
|
|
25
24
|
market: Union[str, Market] = os.environ.get("MASSIVE_MARKET", Market.Stocks)
|
|
26
25
|
subscriptions: Optional[List[str]] = (
|
|
27
|
-
json.loads(os.environ.get("MASSIVE_SUBSCRIPTIONS", '["
|
|
26
|
+
json.loads(os.environ.get("MASSIVE_SUBSCRIPTIONS", '["A.*", "T.*", "Q.*", "LULD.*"]'))
|
|
28
27
|
if os.environ.get("MASSIVE_SUBSCRIPTIONS")
|
|
29
|
-
else ["
|
|
28
|
+
else ["A.*", "T.*", "Q.*", "LULD.*"]
|
|
30
29
|
)
|
|
31
30
|
|
|
32
31
|
# Additional Massive/Polygon.io Settings - default values can be overridden via environment variables
|
|
@@ -70,7 +69,7 @@ async def lifespan(app: FastAPI):
|
|
|
70
69
|
"""Startup and shutdown events"""
|
|
71
70
|
|
|
72
71
|
# Startup
|
|
73
|
-
logger.info("Instantiating
|
|
72
|
+
logger.info("Instantiating Massive Data Listener...")
|
|
74
73
|
global massive_data_listener, massive_data_queues
|
|
75
74
|
|
|
76
75
|
massive_data_queues = MassiveDataQueues(
|
|
@@ -92,20 +91,20 @@ async def lifespan(app: FastAPI):
|
|
|
92
91
|
max_reconnects=settings.max_reconnects,
|
|
93
92
|
secure=settings.secure,
|
|
94
93
|
)
|
|
95
|
-
logger.info("
|
|
94
|
+
logger.info("Massive Data Listener is ready.")
|
|
96
95
|
# NOTE: AUTO-START FEATURE IS DISABLED BY DEFAULT.
|
|
97
96
|
# Non-business licenses are limited to a single WebSocket connection for the entire account.
|
|
98
97
|
# The stop, start, and restart API functionality enables manual control of the WebSocket connection.
|
|
99
98
|
#
|
|
100
99
|
# To enable auto-start, set the environment variable MARKET_DATA_LISTENER_AUTO_START_ENABLED=true.
|
|
101
100
|
if settings.auto_start:
|
|
102
|
-
logger.info("[AUTO-START ENABLED]Starting
|
|
101
|
+
logger.info("[AUTO-START ENABLED]Starting Massive Data Listener...")
|
|
103
102
|
await massive_data_listener.start()
|
|
104
103
|
|
|
105
104
|
yield
|
|
106
105
|
|
|
107
106
|
# Shutdown
|
|
108
|
-
logger.info("Shutting down
|
|
107
|
+
logger.info("Shutting down Massive Data Listener...")
|
|
109
108
|
await stop_websocket_client()
|
|
110
109
|
await massive_data_queues.shutdown()
|
|
111
110
|
|
|
@@ -200,19 +199,19 @@ async def subscriptions(subscriptions_list: List[str]):
|
|
|
200
199
|
|
|
201
200
|
@app.get("/start")
|
|
202
201
|
async def start_websocket_client():
|
|
203
|
-
logger.info("Starting
|
|
202
|
+
logger.info("Starting Massive Data Listener...")
|
|
204
203
|
await massive_data_listener.start()
|
|
205
204
|
|
|
206
205
|
|
|
207
206
|
@app.get("/stop")
|
|
208
207
|
async def stop_websocket_client():
|
|
209
|
-
logger.info("Stopping
|
|
208
|
+
logger.info("Stopping Massive Data Listener...")
|
|
210
209
|
await massive_data_listener.stop()
|
|
211
210
|
|
|
212
211
|
|
|
213
212
|
@app.get("/restart")
|
|
214
213
|
async def restart_websocket_client():
|
|
215
|
-
logger.info("Restarting
|
|
214
|
+
logger.info("Restarting Massive Data Listener...")
|
|
216
215
|
await massive_data_listener.restart()
|
|
217
216
|
|
|
218
217
|
|
|
@@ -225,7 +224,7 @@ async def root():
|
|
|
225
224
|
else:
|
|
226
225
|
ret = "Unhealthy"
|
|
227
226
|
return {
|
|
228
|
-
"service": "
|
|
227
|
+
"service": "Massive Data Listener",
|
|
229
228
|
"status": ret,
|
|
230
229
|
"auto-start": settings.auto_start,
|
|
231
230
|
"container_image": settings.container_image,
|
|
@@ -248,7 +247,7 @@ async def health_check(response: Response):
|
|
|
248
247
|
# status_message = "Unhealthy"
|
|
249
248
|
# response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
|
|
250
249
|
return {
|
|
251
|
-
"service": "
|
|
250
|
+
"service": "Massive Data Listener",
|
|
252
251
|
"status": status_message,
|
|
253
252
|
"auto-start": settings.auto_start,
|
|
254
253
|
"container_image": settings.container_image,
|
|
File without changes
|
|
File without changes
|
{kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/__init__.py
RENAMED
|
File without changes
|
{kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/mdp_server.py
RENAMED
|
File without changes
|
{kuhl_haus_mdp_servers-0.1.9 → kuhl_haus_mdp_servers-0.1.11}/src/kuhl_haus/servers/wds_server.py
RENAMED
|
File without changes
|