fixtureqa 0.1.0__py3-none-any.whl
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.
- fixture/__init__.py +22 -0
- fixture/__main__.py +161 -0
- fixture/api/__init__.py +0 -0
- fixture/api/app.py +95 -0
- fixture/api/connection_manager.py +161 -0
- fixture/api/deps.py +73 -0
- fixture/api/routers/__init__.py +0 -0
- fixture/api/routers/admin.py +178 -0
- fixture/api/routers/auth.py +74 -0
- fixture/api/routers/branding.py +33 -0
- fixture/api/routers/fix_spec.py +41 -0
- fixture/api/routers/messages.py +137 -0
- fixture/api/routers/scenarios.py +65 -0
- fixture/api/routers/sessions.py +272 -0
- fixture/api/routers/setup.py +42 -0
- fixture/api/routers/templates.py +36 -0
- fixture/api/routers/ws.py +129 -0
- fixture/api/schemas.py +289 -0
- fixture/config/__init__.py +0 -0
- fixture/core/__init__.py +0 -0
- fixture/core/auth.py +68 -0
- fixture/core/config_store.py +85 -0
- fixture/core/events.py +22 -0
- fixture/core/fix_application.py +67 -0
- fixture/core/fix_parser.py +79 -0
- fixture/core/fix_spec_parser.py +172 -0
- fixture/core/fix_tags.py +297 -0
- fixture/core/housekeeping.py +107 -0
- fixture/core/message_log.py +115 -0
- fixture/core/message_store.py +246 -0
- fixture/core/models.py +87 -0
- fixture/core/scenario_runner.py +331 -0
- fixture/core/scenario_store.py +70 -0
- fixture/core/session.py +278 -0
- fixture/core/session_manager.py +173 -0
- fixture/core/template_store.py +70 -0
- fixture/core/user_store.py +186 -0
- fixture/core/venue_responses.py +94 -0
- fixture/fix_specs/FIX42.xml +2746 -0
- fixture/fix_specs/FIX44.xml +6593 -0
- fixture/server.py +37 -0
- fixture/static/assets/ag-grid-_QKprVdm.js +326 -0
- fixture/static/assets/index-B31-1dt-.css +1 -0
- fixture/static/assets/index-CTsKxGdI.js +87 -0
- fixture/static/assets/react-vendor-2eF0YfZT.js +1 -0
- fixture/static/favicon.svg +12 -0
- fixture/static/index.html +15 -0
- fixture/ui/__init__.py +0 -0
- fixtureqa-0.1.0.dist-info/METADATA +16 -0
- fixtureqa-0.1.0.dist-info/RECORD +54 -0
- fixtureqa-0.1.0.dist-info/WHEEL +5 -0
- fixtureqa-0.1.0.dist-info/entry_points.txt +2 -0
- fixtureqa-0.1.0.dist-info/licenses/LICENSE +21 -0
- fixtureqa-0.1.0.dist-info/top_level.txt +1 -0
fixture/server.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Starts the FastAPI/uvicorn server in a background daemon thread.
|
|
3
|
+
The QuickFIX engines also run in daemon threads — nothing runs on the main thread
|
|
4
|
+
except whatever the caller wants (CLI, tests, etc.).
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import threading
|
|
8
|
+
import uvicorn
|
|
9
|
+
|
|
10
|
+
from .core.session_manager import SessionManager
|
|
11
|
+
from .api.app import create_app
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def start_server(
|
|
15
|
+
session_manager: SessionManager,
|
|
16
|
+
host: str = "0.0.0.0",
|
|
17
|
+
port: int = 8000,
|
|
18
|
+
log_level: str = "info",
|
|
19
|
+
db_path: str = "./users.db",
|
|
20
|
+
msg_db_path: str = "./data/messages.db",
|
|
21
|
+
log_dir: str = "./log",
|
|
22
|
+
data_dir: str = "./data",
|
|
23
|
+
) -> uvicorn.Server:
|
|
24
|
+
"""
|
|
25
|
+
Start uvicorn in a daemon thread. Returns the Server instance so the
|
|
26
|
+
caller can do `server.should_exit = True` for clean shutdown.
|
|
27
|
+
"""
|
|
28
|
+
app = create_app(session_manager, db_path=db_path, msg_db_path=msg_db_path,
|
|
29
|
+
log_dir=log_dir, data_dir=data_dir)
|
|
30
|
+
# log_config=None prevents uvicorn from calling logging.config.dictConfig(),
|
|
31
|
+
# so uvicorn's loggers propagate to the root logger configured in __main__.
|
|
32
|
+
config = uvicorn.Config(app, host=host, port=port, log_level=log_level, log_config=None)
|
|
33
|
+
server = uvicorn.Server(config)
|
|
34
|
+
|
|
35
|
+
thread = threading.Thread(target=server.run, name="uvicorn", daemon=True)
|
|
36
|
+
thread.start()
|
|
37
|
+
return server
|