fixtureqa 0.1.0__tar.gz → 0.1.1__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.
- {fixtureqa-0.1.0/fixtureqa.egg-info → fixtureqa-0.1.1}/PKG-INFO +1 -1
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/connection_manager.py +20 -31
- {fixtureqa-0.1.0 → fixtureqa-0.1.1/fixtureqa.egg-info}/PKG-INFO +1 -1
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/pyproject.toml +1 -1
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/LICENSE +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/README.md +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/__init__.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/__main__.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/__init__.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/app.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/deps.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/__init__.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/admin.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/auth.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/branding.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/fix_spec.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/messages.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/scenarios.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/sessions.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/setup.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/templates.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/routers/ws.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/api/schemas.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/config/__init__.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/__init__.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/auth.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/config_store.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/events.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/fix_application.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/fix_parser.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/fix_spec_parser.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/fix_tags.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/housekeeping.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/message_log.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/message_store.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/models.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/scenario_runner.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/scenario_store.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/session.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/session_manager.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/template_store.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/user_store.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/core/venue_responses.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/fix_specs/FIX42.xml +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/fix_specs/FIX44.xml +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/server.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/static/assets/ag-grid-_QKprVdm.js +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/static/assets/index-B31-1dt-.css +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/static/assets/index-CTsKxGdI.js +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/static/assets/react-vendor-2eF0YfZT.js +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/static/favicon.svg +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/static/index.html +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixture/ui/__init__.py +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixtureqa.egg-info/SOURCES.txt +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixtureqa.egg-info/dependency_links.txt +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixtureqa.egg-info/entry_points.txt +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixtureqa.egg-info/requires.txt +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/fixtureqa.egg-info/top_level.txt +0 -0
- {fixtureqa-0.1.0 → fixtureqa-0.1.1}/setup.cfg +0 -0
|
@@ -69,7 +69,6 @@ class ConnectionManager:
|
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
71
|
def __init__(self):
|
|
72
|
-
# session_id (or "*") -> dict[WebSocket, _ConnInfo]
|
|
73
72
|
self._clients: dict[str, dict[WebSocket, _ConnInfo]] = {}
|
|
74
73
|
|
|
75
74
|
# ------------------------------------------------------------------
|
|
@@ -79,13 +78,11 @@ class ConnectionManager:
|
|
|
79
78
|
async def connect(self, websocket: WebSocket, session_id: str = "*",
|
|
80
79
|
uid: str = "", is_admin: bool = False) -> None:
|
|
81
80
|
await websocket.accept()
|
|
82
|
-
|
|
83
|
-
self._clients.setdefault(session_id, {})[websocket] = _ConnInfo(uid, is_admin)
|
|
81
|
+
self._clients.setdefault(session_id, {})[websocket] = _ConnInfo(uid, is_admin)
|
|
84
82
|
|
|
85
83
|
def disconnect(self, websocket: WebSocket, session_id: str = "*") -> None:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
clients.pop(websocket, None)
|
|
84
|
+
clients = self._clients.get(session_id, {})
|
|
85
|
+
clients.pop(websocket, None)
|
|
89
86
|
|
|
90
87
|
# ------------------------------------------------------------------
|
|
91
88
|
# Called from the asyncio event loop (fixcore callbacks / scenario runner)
|
|
@@ -105,11 +102,8 @@ class ConnectionManager:
|
|
|
105
102
|
# ------------------------------------------------------------------
|
|
106
103
|
|
|
107
104
|
async def _broadcast(self, session_id: str, payload: dict, owner_uid: str) -> None:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
specific = dict(self._clients.get(session_id, {}))
|
|
111
|
-
# Wildcard subscribers
|
|
112
|
-
wildcard = dict(self._clients.get("*", {}))
|
|
105
|
+
specific = dict(self._clients.get(session_id, {}))
|
|
106
|
+
wildcard = dict(self._clients.get("*", {}))
|
|
113
107
|
|
|
114
108
|
# Build target set: connections that may receive this event
|
|
115
109
|
# A connection receives the event if:
|
|
@@ -126,22 +120,19 @@ class ConnectionManager:
|
|
|
126
120
|
if ws.client_state == WebSocketState.CONNECTED:
|
|
127
121
|
await ws.send_json(payload)
|
|
128
122
|
except Exception:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
dead.append((ws, key))
|
|
123
|
+
for key, sockets in self._clients.items():
|
|
124
|
+
if ws in sockets:
|
|
125
|
+
dead.append((ws, key))
|
|
133
126
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
self._clients.get(key, {}).pop(ws, None)
|
|
127
|
+
for ws, key in dead:
|
|
128
|
+
self._clients.get(key, {}).pop(ws, None)
|
|
137
129
|
|
|
138
130
|
async def _broadcast_to_user(self, uid: str, data: dict) -> None:
|
|
139
131
|
"""Send data to all WS connections belonging to uid."""
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
for
|
|
143
|
-
|
|
144
|
-
all_clients[ws] = info
|
|
132
|
+
all_clients = {}
|
|
133
|
+
for sockets in self._clients.values():
|
|
134
|
+
for ws, info in sockets.items():
|
|
135
|
+
all_clients[ws] = info
|
|
145
136
|
|
|
146
137
|
dead: list[tuple[WebSocket, str]] = []
|
|
147
138
|
for ws, info in all_clients.items():
|
|
@@ -151,11 +142,9 @@ class ConnectionManager:
|
|
|
151
142
|
if ws.client_state == WebSocketState.CONNECTED:
|
|
152
143
|
await ws.send_json(data)
|
|
153
144
|
except Exception:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
for ws, key in dead:
|
|
161
|
-
self._clients.get(key, {}).pop(ws, None)
|
|
145
|
+
for key, sockets in self._clients.items():
|
|
146
|
+
if ws in sockets:
|
|
147
|
+
dead.append((ws, key))
|
|
148
|
+
|
|
149
|
+
for ws, key in dead:
|
|
150
|
+
self._clients.get(key, {}).pop(ws, None)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|